Top 10 Interactive Website Design Trends in 2024.pptx
A Closer Look at Fonts and Font Rendering System on openSUSE
1. A Closer Look at
Fonts and Font Rendering System
on openSUSE
Fuminobu TAKEYAMA
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 1/30
2. About Me
● TAKEYAMA, Fuminobu (武山 文信)
– @ftake, Facebook: takeyamaf, G+: +FuminobuTakeyama
– openSUSE M17N project maintainer
● Multilinguarization
– One of admins of http://ja.opensuse.org/
● Talk about community activities
in Japan tomorrow
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 2/30
3. Do you use a Linux desktop environment?
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 3/30
4. Font and font rendering are
● Important for Desktop environments
● Sometimes troublesome for Chinese and Japanese users
– Because of the letters with complex structures
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 4/30
5. What is a font?
● Defines actual shapes of letters
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 5/30
6. Rendering letters with a font
● Draw letters on pixels
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 6/30
7. New CJK fonts by Adobe and Google
● Noto Sans Chinese/Japanese/Korean (Google)
Source Han Sans (Adobe)
● 7 weight variations
● Support new rendering engine provided by Adobe
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 7/30
8. New CJK fonts by Adobe and Google
to be available on openSUSE 13.2!
though still problematic for GUI
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 8/30
9. Software for font rendering
● FreeType2
– A library for rendering letters
● fontconfig
– System for
● Searching fonts from your system
● Specifying rendering parameters for FreeType2
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 9/30
10. Querying fonts with fontconfig 1/2
● command line interfaces: fc-match, fc-scan, ...
● Query by a family name and attributes
$ fc-match "Noto Sans Japanese"
NotoSansJP-Medium.otf: "Noto Sans Japanese" "Medium"
actual file name weight
$ fc-match "Noto Sans Japanese":weight=Bold
NotoSansJP-Bold.otf: "Noto Sans Japanese" "Bold"
The actual file providing the bold font
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 10/30
11. Querying fonts with fontconfig 2/2
● Some fonts are just aliases
– The actual font is determined by the locale, your settings, ...
$ fc-match "Monospace"
migu-1m-regular.ttf: "Migu 1M" "Regular"
Monospace is an alias of Migu 1M (on my env.)
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 11/30
12. Another role of fontconfig
● Specifies rendering parameters for each font
– Anti-aliasing
– Hinting
– Sub-pixel rendering
● Defined by files
– /etc/fonts/*
– ~/.config/fontconfig/*
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 12/30
13. Hinting
● Moves lines to fit pixels
– Makes letters look clear
With hinting Without hinting
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 13/30
14. Hinting parameters for FreeType2
● Hinting engines
– FreeType's auto hinter
– Byte code interpreter for fonts with hinting instructions
– “Adobe” for CFF fonts (including Noto Sans C/J/K)
● Hintstyle
– None: just disable hinting
– Slight: render with the auto hinter (slight mode)
– Medium, Full: BCI or Adobe if available
● otherwise auto hinter (normal mode)
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 14/30
15. Inappropriate hintstyle 1/2
● Hinting is sometimes problematic
● “_” is not printed
disappear
With hintnone
With hintmedium
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 15/30
16. Inappropriate hintstyle 2/2
● Breaks some monospaced fonts
Deskto”p”
Publi”c”
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 16/30
17. Which is the best hintstyle?
● Different for each font
You should use packaged fonts!
– openSUSE's font packages set appropriate values
for problematic fonts
– See: /etc/fonts/conf.d/*
● [10-19]-*.conf: openSUSE default option
● [20-29]-*.conf: rendering options for each font
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 17/30
18. The Kcontrol bug 1/3
● Bug 105797 - Changing fonts from Kcontrol will enable
hinting and make it default. All this information it
writes to ~/.fonts.conf
● Reported on
– 2005-05-17
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 18/30
19. The Kcontrol bug 2/3
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 19/30
20. The Kcontrol bug 3/3
Breaks some fonts
● Automatically saves settings enforcing hintmedium
for all fonts
– Please remove ~/.config/fontconfig/* generated by this
● Resolved in 13.2
– By “System default”
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
… snip …
<match target="font">
<edit mode="assign" name="hintstyle">
<const>hintmedium</const>
</edit>
</match>
… snip …
</fontconfig>
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 20/30
21. Not only KDE
● Exists on XFCE
– Also on GNOME
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 21/30
22. Trouble shooting
● Check your rendering configuration by fc-match -v
– The actual font name, hinting settings
$ fc-match -v Sans
Pattern has 36 elts (size 48)
family: "IPA Pゴシック"(s) "IPAPGothic"(s)
familylang: "ja"(s) "en"(s)
** snip **
antialias: True(w)
hintstyle: 2(i)(w)
hinting: True(w)
verticallayout: False(s)
** snip **
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 22/30
23. Infinality patch
● Unofficial patch improving FreeType2
● Has been merged into FreeType2
– fontconfig settings from infinality is to be included by
openSUSE 13.2
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 23/30
24. Sub-pixel rendering on openSUSE
● Improve resolution by using RGB sub-pixel of LCD
● Disabled
– Because color filter algorithm is still patented
● Need discussion
– if FreeType's color filter is really
covered by the patent or not
Sub-pixel rendering by Windows ClearType
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 24/30
25. Development of font packages
● M17N:fonts on Open Build Service
– https://build.opensuse.org/project/show/M17N:fonts
– ML: opensuse-m17n@opensuse.org
● Everyone can join the development
● Easy to develop
1. Branch a package from M17N:fonts
2. Just update zip/tar.gz and write change log
3. Build and test
4. Submit your change to M17N:fonts
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 25/30
26. A font catalog
● http://fontinfo.opensuse.org/ By Petr Gajdos
1 click install
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 26/30
27. Ongoing issues
● Multi-weight font support
– Fontconifg cannot query correctly
$ fc-match "Noto Sans Japanese":weight=Regular
NotoSansJP-DemiLight.otf: "Noto Sans Japanese" "DemiLight"
– Gtk also
● The Adobe engine is disabled on some applications
● Sub-pixel rendering
– Hinting engines seem to require it
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 27/30
28. Conclusion
● FreeType2 and fontconfig
– fc-match -v for trouble shooting and bug reports
● Hinting
– Provides clear rendering or causes problems
● Need your help
– Addressing ongoing issues
– Packaging fonts with appropriate configurations
● Any questions?
2014-10-17 A Closer Look at Fonts and Font Rendering System on openSUSE 28/30