Monospaced font / createSystemTypefaceFor / CodeEditor issue


When i create a monospaced font using:

Font f (Typeface::createSystemTypefaceFor (BinaryData::FifteenNarrow_ttf, BinaryData::FifteenNarrow_ttfSize));

I can't set it to the CodeEditorComponent. The font i create is monospaced (i tried several different ones), but it always falls back

to some king of non-monospaced font (i guess OS default?). Is this a limitation of the CodeEditorComponent that it doesn't know

that a font is monospaced when using a TTF/OTF file ?


I tested this also with with (free font) and it doesn't work, in case a test font is needed.

I tried installing the font in the OS, and it works in the CodeEditorComponent then (when choses from OS fonts), however when i installed a font that is also monospaced it still does not work (even when installed in the OS font set).

This is all on Windows 7 with VS2010


Got a code snippet I could use to reproduce this?


Here is a pure Introjucer project with the fonts embedded and 3 code editors and 3 labels showing those embedded fonts (using)

Font f1 (Typeface::createSystemTypefaceFor (BinaryData::NotCourierSans_otf, BinaryData::NotCourierSans_otfSize));

just unpack and build.

In case you'd like to see the result a screenshot is below




Thanks - there was a problem with DirectWrite that stopped it working with from-memory fonts. I've added a workaround now, so hopefully that should sort your problem out.


Works now, thank you.