How to set width of font for fixed-width string



Hello Pango experts,

 

I am new to the Pango world.  Our application requires fixed-width font for mixed string of Chinese and Latin glyphs.  For example,  a string containing Chinese and Latin  characters requires each glyph to be 16x24 sometimes but it requires it to be 24x24 in other times.

 

I browsed through pango API and the only available API to set font width is to

         pango_font_description_set_stretch

 

However, the API’s input parameter is an enumeration of :

  PANGO_STRETCH_ULTRA_CONDENSED,

  PANGO_STRETCH_EXTRA_CONDENSED,

  PANGO_STRETCH_CONDENSED,

  PANGO_STRETCH_SEMI_CONDENSED,

  PANGO_STRETCH_NORMAL,

  PANGO_STRETCH_SEMI_EXPANDED,

  PANGO_STRETCH_EXPANDED,

  PANGO_STRETCH_EXTRA_EXPANDED,

  PANGO_STRETCH_ULTRA_EXPANDED

 

and after testing of these enumerators, none of these option give me a fixed width for both Chinese and latin glyphs.

 

The other API I tried is to use  low level API:

 glyphString->glyphs[k].geometry.width

 

Original Chinese’Chinese glyph’s width is wider than font’s width. This API does not seem to change chinese glyph’s width. Rather, it make consecutive Chinese glyphs to overlap each other, causing ineligibility.

 

What’s the correct way to set a glyph to a certain fixed width for both Chinese and latin characters?

 

Regards and thanks in advance,

 

Brian Wei

AGCO Corporation



This email is intended solely for the use of the individual to whom it is addressed and may contain confidential and/or privileged material. Any views or opinions presented are solely those of the author and do not necessarily represent those of AGCO. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing or copying of this email is strictly prohibited. Neither AGCO nor the sender accepts any responsibility for viruses and it is your responsibility to scan and virus check the e-mail and its attachment(s) (if any).


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]