Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some characteres are not rendered #117

Open
TomQv opened this issue Jan 12, 2018 · 8 comments
Open

Some characteres are not rendered #117

TomQv opened this issue Jan 12, 2018 · 8 comments

Comments

@TomQv
Copy link

TomQv commented Jan 12, 2018

I'm trying to render this string using "Arial Unicode.ttf":

var test = _fontFace.GetCharIndex(oneletter);
_fontFace.LoadChar(oneletter, LoadFlags.Render, LoadTarget.Normal);
var ftbitmap = _fontFace.Glyph.Bitmap;

Morocco / Maroc ⴰⵎⵔⵔⵓⴽ المغرب

The middle-part ⴰⵎⵔⵔⵓⴽ is not rendered, the rest is fine. For the letters which are not rendered, the test=GetCharIndex is also 0. I'm not very familiar with these font/unicode-stuff, maybe this letter is just not in Arial? But when I paste the string for example in an editor and use Arial, its rendered fine.

Is there a trick to get these letters rendered too?

Thanks
Tom

@HinTak
Copy link
Contributor

HinTak commented Jan 12, 2018

If you want automatic glyph substitution you want something a bit higher level than freetype (and SharpFont). Perhaps cairo (cairoSharp)? Alternatively you might want to use a font with wider coverage, such as one of the google pan cjk ones?

@TomQv
Copy link
Author

TomQv commented Jan 12, 2018

Is it really a problem with the font?
When I use that font eg. in OpenDocument Text, the string is displayed correctly.
So this looks like if these characters are actually included in Arial Unicode

arial_maroc

@TomQv
Copy link
Author

TomQv commented Jan 12, 2018

And this is the output from SharpFont:

arial_maroc2

(ignore, that arabic is wrong direction, thats my bug)

@Robmaister
Copy link
Owner

@HinTak is correct, the font itself likely doesn't have those glyphs in it. LibreOffice itself uses Cairo for the higher level text rendering logic, like substituting missing glyphs for those in a default (or similar) font.

Cairo, in turn, uses freetype to render glyphs.

@HinTak
Copy link
Contributor

HinTak commented Jan 12, 2018

@TomQv In the case of OpenDocument, the OS's display system (i.e. windows or gtk) did the substitution for you. The same thing happens if you type those texts in a text box on the browser. It is perhaps happening even higher than Cairo, at the pango (i.e. layout of sentences and words) level.

Pango/Cairo uses fontconfig to find other fonts for relevant substitutions, before invoking freetype. The right-to-left layout in LibreOffice is done by pango.

@TomQv
Copy link
Author

TomQv commented Jan 12, 2018

Thanks, so I must find a more complete font, since I don't want to go for cairo or similar, SharpFont is just right for us.
We are using this to render maps, so perfect would be a font, which contains a worldwide coverage of charsets.
Any suggestions? HinTak recommended google pan cjk, but this seems to be asian only.

@HinTak
Copy link
Contributor

HinTak commented Jan 12, 2018

I meant the Google Noto fonts. They supports CJK, but not only CJK. Hanazono is also extremely large.

Wikipedia has a list...
https://en.wikipedia.org/wiki/Open-source_Unicode_typefaces

@TomQv
Copy link
Author

TomQv commented Jan 12, 2018

Google Noto has this font, its in "Berber (Tifinagh script)", and only there. and no others.
Looks like, this is the case, when cairo comes in.
Or is there functions in SharpFont to determine the language of a character and find a suitable font?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants