Cannot able to load OpenTypeFonts

I am havig a font with OpenType Layout, PostScript Outlines. It is not loading by default.

I tried the solution in
http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=4208&highlight=opentype+font
but still it is not loading.
This font is loading in wordpad . I hope it is fixable.

In the following methos
static int CALLBACK wfontEnum1 (ENUMLOGFONTEXW* lpelfe,
NEWTEXTMETRICEXW*,
int type,
LPARAM lParam)

the following condition
if (lpelfe != 0
&& ((type & (DEVICE_FONTTYPE | RASTER_FONTTYPE)) == 0))

fails as the type of the font which i am having is only DEVICE_FONTTYPE…
If we dont check for the type will there be any issue.

Thanks - I just checked on MSDN and it does look like that DEVICE_FONTTYPE implies an opentype font, so I’ll sort that out. And I think I might also need to fix the test on line 43 as well, which will also reject opentype fonts.

Can you post the fix for this issue

It’s already checked in.

Can’t able to draw text for following Typefaces

  1. Roman
  2. Modern
  3. Script

I checked this issue in the jucedemo.exe available in site.
Only those three rows shows blank.
I think this issue is there only after showing up opentypefonts also

Hi Julian,
I have a question, why don’t you use FreeType library for the font related coding? That way you can do away with Macintosh and Window specific codes.

[quote]Can’t able to draw text for following Typefaces

  1. Roman
  2. Modern
  3. Script [/quote]

Thanks - I’ll take a look into that…

[quote=“vishvesh”]Hi Julian,
I have a question, why don’t you use FreeType library for the font related coding? That way you can do away with Macintosh and Window specific codes.[/quote]

I’d have to embed it into the codebase, which would be a total pain… On linux it’s easily available on the system, but win32/mac users would need to get it from somewhere.

I do understand it would be painful changing the old code, but it would be one time pain, instead of changing the code for all the platform if you have to add new features for font.

I prefer writing code in juce instead of cocoa/carbon because single piece of code does the trick.

You can always ask developers to download code from other links like for QuickTime SDK.

But your judgement have been consistently better than mine, so I will leave it at this.

Hi Julian,
Can you please update this post once after you fix the issue.

Ok, just had a look - all those fonts are raster fonts, so no wonder they don’t work!

They shouldn’t really appear on the list, but for some reason the RASTER_FONTTYPE flag isn’t being correctly set for them…

In the following link
http://msdn.microsoft.com/en-us/library/ms901125.aspx,

RASTER_FONTTYPE - The font is a raster font. If neither RASTER_FONTTYPE nor TRUETYPE_FONTTYPE is set, the font is a vector font.

Are those three typeface are Vector fonts?

I know what MSDN says, but look in Vista’s font folder and it says “raster” next to them. And when you preview them, they’re clearly drawn with bitmaps.

No idea why they’re getting flagged as vectors, but they sure ain’t vector-based!

Any conditions added to hide those raster fonts.

Can we have any condition to check the type value should not be 0 and RASTER_TYPE, will it affect anything. Is there any possibilities to have any vector font with 0 as value.

I really don’t know - since the flags don’t seem to behave the way the documentation says they do, I guess it’d be a case of trial and error to see if that’d work.