Font Name and Sample Text displays

Caolán McNamara caolanm at
Fri Mar 29 16:04:00 UTC 2019

On Fri, 2019-03-29 at 09:37 -0700, I Write wrote:
> In LibreOffice, when Tools->Options->"Fonts Lists"->"Show preview of
> fonts" is checked, a sample text is displayed to the right of some
> fonts that contain non-latin glyphs (for example, Malgun Gothic shows
> Korean characters). I am working with a font for a new writing
> system/language (added to Unicode 7.0) so there isn't many
> applications that support the writing system. Where can I find the
> algorithm in Libreoffice that determines what text to display
> (preview) for a non-latin font, so that I can modified it for my
> language?

This is mostly svtools/source/misc/sampletext.cxx

makeShortRepresentativeTextForScript makes the short text which is put
beside the fontname in the font dropdown. While
makeRepresentativeTextForLanguage is the long text shown in font

In your case I expect the font enters
getScript(const vcl::FontCapabilities &rFontCapabilities) and either...

a) the target script of your font can't be guessed,
b) its guessed correct, but makeShortRepresentativeTextForScript has no
entry for the script

> Is there a way to incorporate this for future releases of
> Libreoffice?

Sure, submit a patch with your additions like this:
and feel free to put me on cc on the gerrit review

More information about the LibreOffice mailing list