This is also an old bug with Arabic font in OpenOffice.org [1]. here is the description: Arabic fonts do not display correctly like English font when we want to choose a font for format a text. [1] http://qa.openoffice.org/issues/show_bug.cgi?id=49653
caolan have you any ideas about this ( feel free to re-assign back to the list etc. etc. )
This will probably strike you as a stupid question, but what *is* the Arabic text written beside the font name in the MSOffice preview. i.e. a) Is it a localized name of the font, and I'm just failing to find where in e.g. the Andalus font that name is found, or... b) Is it some random "sample text" that is always the same and written beside Arabic fonts when they don't have an Arabic name.
I am not sure about this but it is just a random text like this: أبجد هوز BTW libreOffice display Chinese fonts very well see this: http://img401.imageshack.us/img401/3189/snapshot2w.png
Yeah, the Asian fonts typically have a few names fields in them, and include a name for itself in its own language. Looking at some sample Arabic fonts they typically only name themselves in English. So I assume the required magic is to detect Arabic (and probably some other script) fonts and stick some same text as the preview string. We sort of do this for our symbol fonts. So I reckon what we need it to distinguish a font that *has* an English name, *and* has glyphs to render its own name, but is designed for Arabic text and for the preview treat it a little like a symbol font and render some sample other text in it. Maybethe otlayout:arab key might be sufficient for this.
Uh huh, أبجد هوز حطي كلمن سعفص قرشت ثخذ ضظغ These meaningless words collect all Arabic letters I guess that's the origin of the preview text, the first two words of that are taken as the same text.
I guess we could query the GSUB header, and if it has one for "arab", and for nothing else I suppose, we can make it a candidate for preview rendering of some same Arabic text beside its name.
(In reply to comment #6) > I guess we could query the GSUB header, and if it has one for "arab", and for > nothing else I suppose, we can make it a candidate for preview rendering of > some same Arabic text beside its name. This approach seems ok but I have a concern that many fonts support many languages like: Tahoma, DejaVu fonts, and ubuntu font.
Yeah, that's the open question. I'm thinking that we should only show Arabic preview text is the font *only* supports otlayout:arab, so e.g. "DejaVu Sans Mono" supports otlayout:arab, otlayout:cyrl, otlayout:grek, etc. and would have no Arabic preview, while "Paktype Naqsh" only supports otlayout:arab and *would* have an Arabic preview. Any extend this for other script/languages as well, so e.g. "Lohit Tamil" with only otlayout:taml would have a Tamil preview.
Created attachment 42752 [details] So, how does this look to you ?
Created attachment 42777 [details] stash this here for a bit
(In reply to comment #8) > Yeah, that's the open question. I'm thinking that we should only show Arabic > preview text is the font *only* supports otlayout:arab, so e.g. "DejaVu Sans > Mono" supports otlayout:arab, otlayout:cyrl, otlayout:grek, etc. and would have > no Arabic preview, while "Paktype Naqsh" only supports otlayout:arab and > *would* have an Arabic preview. > > Any extend this for other script/languages as well, so e.g. "Lohit Tamil" with > only otlayout:taml would have a Tamil preview. I tried to build LibreOffice but I failed. Anyway, it would be better if the libreoffice shows preview for Latin letters and the CTL local if is there. I mean, if I enabled Aarbic Oman local, the font preview will show me latin and arabic preview, despite the font support arabic or not.
>+ rSampleText = rtl::OUString("ﺺِﻓ ﺦَﻠﻗَ ﺥَﻭﺩِ ﻚَﻤِﺜﻟِ ﺎﻠﺸَﻤﺳِ ﺇِﺫ ﺏَﺰَﻐَﺗ ﻲَﺤﻇﻯ ﺎﻠﻀَﺠﻴﻋُ ﺐِﻫﺍ ﻦَﺟﻻﺀَ ﻢِﻌﻃﺍﺭِ ", strlen("ﺺِﻓ ﺦَﻠﻗَ ﺥَﻭﺩِ ﻚَﻤِﺜﻟِ ﺎﻠﺸَﻤﺳِ ﺇِﺫ ﺏَﺰَﻐَﺗ ﻲَﺤﻇﻯ ﺎﻠﻀَﺠﻴﻋُ ﺐِﻫﺍ ﻦَﺟﻻﺀَ ﻢِﻌﻃﺍﺭِ "), RTL_TEXTENCODING_UTF8); This sample text string is bogus, looks like a broken attempt to pre-shape it or something. It should be: صِف خَلقَ خَودِ كَمِثلِ الشَمسِ إِذ بَزَغَت يَحظى الضَجيعُ بِها نَجلاءَ مِعطارِ Though "أبجد هوز..." is more widely used as an Arabic pangram (though it is not strictly a pangram but rather a mere aggregation of Arabic alphabet in the Abjadi order).
Yeah, it was just a quick and dirty cut and paste for demo purposes. Decided against pangrams eventually, too long :-)
Created attachment 42987 [details] how about this ? How does this look to you ?
(In reply to comment #14) > Created an attachment (id=42987) [details] > how about this ? > > How does this look to you ? It looks nice even there is a long space between English preview and Arabic preview.
done now for 3.4