I'm using ActionTest (latest version) under WINE 1.3.37 on Kubuntu 11.10. The problem is not new, been around for several years; I just haven't gotten around to figuring it out.
ActionTest works fine in WINE using ANSI files/text. Not so with Unicode. If I copy Unicode text and paste it into ActionTest two things malfunction.
1. It is not possible to change the font of existing or new text; setting text as Bold has no effect either.
2. Text that is Italic shows properly in the text editor and print preview but prints out as normal rather than italics.
Both of these issues exist only in WINE, things function correctly in Windows. The issues have been around since at least WINE 1.1.xx and Kubuntu 8.04. Is it something that needs fixing in ActionTest/TRichView or in WINE?
Here's what I got for a response over at the WINE bug forum:
The problem is that RichView class (that the application is using internally)
decides to use font "times new roman" with charset 128 (SHIFTJIS_CHARSET) for
unicode text, and Wine chooses some random, i.e. "appropriate" font from an
underlying system which contains glyphs from that charset, but unfortunately
most (if not all) such fonts don't have a bold/italic faces.
If I hack dlls/gdi32/freetype.c,freetype_SelectFont() to ignore 128 charset,
then I can change text to bold, italic and so on, because now real Times New
Roman font is used, which supports them.
You may try to file a bug report to the creator(s) of RichView.
RichView applies Charset specified by the user in TextStyle.Charset.
You can modify your document and change charset of text styles to DEFAULT_CHARSET.
(TRichView cannot just ignore charset of TextStyles even for Unicode font. As far as I know, one value of charset is important - SYMBOL_CHARSET)
Using the ActionTest demo from the download page, how do I change the charset? I guess the question also applies when using the RichView class within another application, too.
Yes, this text uses SHIFTJIS_CHARSET.
And the same problem happens to it in Windows (at least in my version of WinXP where Times New Roman does not have Japanese characters): when I load this text in ActionTest demo, it is displayed using another font, not Times New Roman!
I selected all text, opened "Font | Font... (Advanced)", chose Script="(Default)", applied. Now all text is displayed in Times New Roman.
Figured it out. I looked at the rvf file generated with unicode and then tracked it back from there. Apparently TRichView and whatever other libraries it uses don't know how to handle printing italic type when there's no italic ttf to go with the font. I was using Tahoma font, there's no "standard" italic form of the font like there is for Arial, Verdana, etc. (e.g. ariali.ttf, verdanai.ttf). As long as the ttf for italic text exists, TRichView can handle printing it ok in WINE.
OK, on further investigation maybe there's a better way to look at it.
If an italic style font actually exists (ariali.ttf, for example) that name gets assigned in TRichView. It then prints correctly whether in WinXP or WINE.
If there's no italic style font (as is standard for Tahoma) then TRichView uses the base font and assigns the italic style to it. That works fine for printing in WinXP; it doesn't work in WINE. At this point, I assume it is a WINE problem, somewhere in the stuff that handles printing that doesn't recognize the style flag.
TRichView just sets Canvas.Font.Style, which in its order calls WinAPI's CreateFontIndirect (or, if TextStyle's CharScale<>100, then TRichView uses CreateFontIndirect directly). In the both cases, LogFont's quality and precision are set to defaults.
Specifics like using synthesized italic or not is implemented by OS, as I understand.