Re: Fwd: Drawing vertical text glyphs

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

 



Hi Lubos,

I investigate a little bit more in last few days.

Since Libreoffice unified all the text layout to use Harfbuzz, it would be best to achieve the result consistent with output generated from Harfbuzz utilities. Binaries can be downloaded from [1]. Here are some examples I use to verify:

./hb-view -O png -o ~/output.png \
--shapers=ot,fallback \
--direction ttb \
--font-funcs=ot \
~/下載/kaiu.ttf "「風調,雨順」"

./hb-shape -O text \
--shapers=ot,fallback \
--direction ttb \
--font-funcs=ot \  
~/下載/kaiu.ttf "「風調,雨順」"

You can check if it is a text renderer's problem this way when something goes wrong.
Note that LibreOffice use default font function implementation from Harfbuzz (opentype, --font-funcs=ot ), while the utility use  Freetype library ( --font-funcs=ft ) by default. I find that an
important Windows built-in font (Kaiu.ttf) doesn't work well with Harfbuzz ot font functions.

Skia text renderer works with [2], but it means that other text renderers are broken.
Since Harfbuzz utilities also use Cairo, I believe we must be able to achieve consistent results
at least with Cairo.  My fix there seems to work[3].

For Windows, I think it's not possible to make old ExTextOutW API correct for vertical writing. It is possible to use DWriteTextRenderer for vertical writing[4][5]. There are still some clipping issues, though.

I don't have a Mac so someone needs to fix that if it's broken.

[1]https://github.com/harfbuzz/harfbuzz/releases
[2]https://gerrit.libreoffice.org/c/core/+/115014
[3]https://gerrit.libreoffice.org/c/core/+/115018   
[4]https://gerrit.libreoffice.org/c/core/+/115016 
[5]https://gerrit.libreoffice.org/c/core/+/115017 




--
Mark Hung
_______________________________________________
LibreOffice mailing list
LibreOffice@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/libreoffice

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux