Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Aug 2015 19:15:23 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 202728] Global X11 fonts rendering problem CJK/Webfont etc.
Message-ID:  <bug-202728-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202728

            Bug ID: 202728
           Summary: Global X11 fonts rendering problem CJK/Webfont etc.
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: freebsd-ports-bugs@FreeBSD.org
          Reporter: sasamotikomi@gmail.com

Many fonts are rendering wrong or very bad especially CJK and webfont(MS)
For example rendering of Japanese:
VNDB page of port narcissu
(https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195800) :
https://vndb.org/v10
Katakana rendered only half, part of characters is "transparent/invisible"
Howto fix it:
bring your local.conf to this kind of
$ vi(or ee) /usr/local/etc/fonts/local.conf

<?xml version="1.0"?>
      <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
 <fontconfig>
        <match target="font">
                <edit mode="assign" name="hinting">
                        <bool>true</bool>
                </edit>
        </match>
        <match target="font">
                <edit mode="assign" name="hintstyle">
                        <const>hintslight</const>
                </edit>
        </match>
        <match target="font">
                <edit mode="assign" name="antialias">
                        <bool>true</bool>
                </edit>
        </match>
        <match target="pattern">
           <test qual="any" name="size" compare="less_eq">
              <int>12</int>
          </test>
           <edit name="antialias" mode="assign">
                <bool>false</bool>
           </edit>
        </match>
</fontconfig>


Not forget add this if you use lcd:
  <match target="font">
    <edit mode="assign" name="lcddefault">
      <const>lcddefault</const>
    </edit>
  </match>
    <edit name="rgba" mode="assign">
      <const>rgb</const>
    </edit>
  </match>
Rebuild the font caches and restart Firefox or better xorg-server
$ fc-cache -f
Now fonts is readable but turned into "rainbow" to fix it:
bring your fonts.conf to same kind of local.conf
$vi(or ee) /home/youruser/.config/fontconfig/fonts.conf
$ fc-cache -f
If it still happen replace webfont with analog from ChromeOS:
https://freshports.org/x11-fonts/croscorefonts-fonts-ttf/
https://freshports.org/x11-fonts/crosextrafonts-carlito-ttf/
https://freshports.org/x11-fonts/crosextrafonts-caladea-ttf/

add to your local.conf:
  <alias>
    <family>serif</family>
    <prefer><family>Tinos</family></prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer><family>Arimo</family></prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer><family>Arimo</family></prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer><family>Cousine</family></prefer>
  </alias>

  <match>
    <test name="family"><string>Arial</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Arimo</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Helvetica</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Arimo</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Verdana</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Arimo</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Tahoma</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Arimo</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Times New Roman</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Tinos</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Times</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Tinos</string>
    </edit>
  </match>
    <match>
    <test name="family"><string>Consolas</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Cousine</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Courier New</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Cousine</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Calibri</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Carlito</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Cambria</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Caladea</string>
    </edit>
  </match>
$ fc-cache -f
For programs who not support it:
/home/yourname/.Xresources

Xft.autohint: 0
Xft.lcdfilter:  lcddefault #optional LCD
Xft.hintstyle:  hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb #optional LCD
Xft.dpi: 170 #optional use your real dpi


Problem with Chinese is Hanzi rendering only halfsize and many application such
Firefox not make any differences between Chine and Japanese. I don't know how
fix it.
Cyrillic have troubles with gaps size between characters.
Fonts rendering are differences between application.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-202728-13>