[haiku-development] Re: How to identify an Fixed font

  • From: 韩鹏飞 <pengphei@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Thu, 17 May 2012 09:07:16 +0800

Thank both of you.

在 2012年5月15日星期二,Stefano Ceccherini 写道:

> 2012/5/15 韩鹏飞 <pengphei@xxxxxxxxx <javascript:;>>:
> > Hello all.
>
> Hi,
>
> > As for the tickets about Chinese fonts issues. I found that the key of
> them
> > is Fixed font.
> >
> > for some apps or web pages, Fixed font is used as the default font
> showing
> > them, but
> > the Fixed fonts setting by Haiku can't be set as Chinese font, like
> > WenQuanYi fonts.
>
> That's because those fonts (like, AFAIK, every other CJK font) are not
> fixed fonts.
> Unlike a traditional fixed font, where all the glyphs have the same
> width, CJK fonts contains glyphs of two different widths (called
> fullwidth and halfwidth).
> http://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms
>
>  Haiku has an api to identify these kind of fonts
> (BFont::IsFullAndHalfFixed()), although it's not implemented
> correctly, at the moment, because freetype (the library we use for
> handling fonts) doesn't return this information.
> What can be done:
> the app_server could, on font load, check all the glyphs contained in
> a given font to see if they are of just two different widths, and then
> add a flag to mark it as "full and half fixed".
> I have no idea if this would have acceptable performances.
> Then, when this api works, applications could chose to handle these
> kind of fonts (Terminal does, for example).
>
I know about what is going on. Because WenQuanYi font includes
full-width and half-width font glyphs. so it was identified "non fixed".
if we can seperate the font package, get the full-width part for showing
fixed chars
and fix the  half-path for showing the referring chars.

This will be better.

>
> > So when they are displaying, the Chinese chars can't be rendered
> correctly
> > instead of
> > a rectangle box.
> >
> > So how does Haiku font server identify Fixed Fonts?
>
> We check a flag returned by freetype, which (correctly) doesn't
> classify these fonts as fixed fonts, because they are not.
>
> > As far as I known, WenQuanYi  ZenHei font is Fixed width, but it can't be
> > identified as
> > Fixed. If we can fix this problem, then the Chinese fonts displaying
> problem
> > will be solved.
>
> See above.
> Hope it's clear enough.
> Bye!
>
> cheers!

--kurain



-- 
淡泊明志,宁静致远。

Other related posts: