Search code examples
vbawindowsdirectwrite

Where can I get a copy of Dwrite_1.dll?


On Windows 10, I am trying to write VBA code to list the Unicode code point ranges in a font.

I was able to use GetFontUnicodeRanges in gdi32.dll, but it does not handle code points beyond xFFFF.

Further research uncovered GetUnicodeRanges (as part of DirectWrite), in Dwrite_1.dll, which should handle all Unicode code points, but that is not on my system (although I have Dwrite.dll which does NOT contain GetFontUnicodeRanges.

I searched SO, the internet at large and Microsoft's web sites but could not find that dll.

Question: Does anyone know how/where I can get a copy of Dwrite_1.dll?


Solution

  • There is no DWrite_1.dll. You're mixing up the dll with the header file: the GetUnicodeRanges method is implemented in the IDWriteFont1 and IDWriteFontFace1 interfaces, which are supported in the DWrite_1.h header file.

    DWrite makes use of COM. You start by calling the DWriteCreateFactory function to get a factory interface — that is, an object that implements the requested factory interface. DWrite has multiple factory interfaces which correspond to different versions --- IDWriteFactory (v1), IDWriteFactory1 (v2), etc., each adding new functionality.

    IIRC, VBA makes use of COM, but I've never tried to call into DWrite.dll from VBA. I'd search for discussions on VBA calling into COM interfaces.

    Do you really need to do this programmatically? There are tools you can use to inspect fonts. I've long used SIL ViewGlyph; also check out BabelMap.