Monospaced font / createSystemTypefaceFor / CodeEditor issue


#1

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 http://openfontlibrary.org/en/font/notcouriersans (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 http://openfontlibrary.org/en/font/fifteen 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


#2

Got a code snippet I could use to reproduce this?


#3

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));

 

http://ctrlr.org/nightly/utility/FontRender.zip

just unpack and build.

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

 

 


#4

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.


#5

Works now, thank you.