Skip to content
This repository was archived by the owner on Dec 14, 2021. It is now read-only.
This repository was archived by the owner on Dec 14, 2021. It is now read-only.

Font rendering issues (Fontconfig error when starting Sourcetrail) #518

@cjustin88

Description

@cjustin88

DPI scaling issue:
When using Sourcetrail on my laptop's screen (1920x1080, 157 ppi), the font is legible:
screenshot from 2017-11-10 13-21-30
but when I drag it to my external monitor (1920x1200, 94 ppi), the font becomes very small
screenshot from 2017-11-10 13-20-29
:
Is this the expected scaling behaviour? I thought that the physical size of the font on the lower PPI screen should be larger, but it in fact becomes smaller. When looking at both screenshots at the same scaling, the font is indeed rendered at a smaller size on the lower PPI screen than on the higher screen.

Font config issue:
Sourcetrail seems to have some trouble loading the font so it defaults to the Monospace font? For instance:
screenshot from 2017-11-10 13-29-31
does not look like the font used in the screenshots on Sourcetrail page (and it doesn't look like Source Code Pro which is what it defaulted to).
When I launch Sourcetrail, I get this warning:

➜  Sourcetrail sourcetrail
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 78: saw unknown, expected number

(the contents of 10-scale-bitmap-fonts.conf is at the end of this message)

I do have Source Code Pro installed:

➜  ~ fc-list
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-BlackIt.otf: Source Code Pro,Source Code Pro Black:style=Black Italic,Italic
/usr/share/fonts/lyx/eufm10.ttf: eufm10:style=LyX
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-LightIt.otf: Source Code Pro,Source Code Pro Light:style=Light Italic,Italic
/usr/share/fonts/lyx/cmsy10.ttf: cmsy10:style=LyX
/usr/share/fonts/lyx/msam10.ttf: msam10:style=LyX
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Bold.otf: Source Code Pro:style=Bold
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Regular.otf: Source Code Pro:style=Regular
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Medium.otf: Source Code Pro,Source Code Pro Medium:style=Medium,Regular
/usr/share/fonts/lyx/cmmi10.ttf: cmmi10:style=LyX
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-MediumIt.otf: Source Code Pro,Source Code Pro Medium:style=Medium Italic,Italic
/usr/share/X11/fonts/Type1/c0611bt_.pfb: Courier 10 Pitch:style=Bold Italic
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Light.otf: Source Code Pro,Source Code Pro Light:style=Light,Regular
/usr/share/X11/fonts/Type1/UTBI____.pfa: Utopia:style=Bold Italic
/usr/share/X11/fonts/Type1/c0419bt_.pfb: Courier 10 Pitch:style=Regular
/usr/share/fonts/lyx/wasy10.ttf: wasy10:style=LyX
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Black.otf: Source Code Pro,Source Code Pro Black:style=Black,Regular
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-ExtraLight.otf: Source Code Pro,Source Code Pro ExtraLight:style=ExtraLight,Regular
/usr/share/X11/fonts/Type1/c0648bt_.pfb: Bitstream Charter:style=Regular
/usr/share/fonts/lyx/esint10.ttf: esint10:style=LyX
/usr/share/fonts/lyx/rsfs10.ttf: rsfs10:style=LyX
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-BoldIt.otf: Source Code Pro:style=Bold Italic
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-ExtraLightIt.otf: Source Code Pro,Source Code Pro ExtraLight:style=ExtraLight Italic,Italic
/usr/share/fonts/lyx/stmary10.ttf: stmary10:style=LyX
/usr/share/X11/fonts/Type1/cursor.pfa: Cursor:style=Regular
/usr/share/X11/fonts/Type1/UTB_____.pfa: Utopia:style=Bold
/usr/share/fonts/lyx/cmex10.ttf: cmex10:style=LyX
/usr/share/X11/fonts/Type1/c0583bt_.pfb: Courier 10 Pitch:style=Bold
/usr/share/X11/fonts/Type1/UTI_____.pfa: Utopia:style=Italic
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-SemiboldIt.otf: Source Code Pro,Source Code Pro Semibold:style=Semibold Italic,Italic
/usr/share/X11/fonts/Type1/c0582bt_.pfb: Courier 10 Pitch:style=Italic
/usr/share/fonts/lyx/msbm10.ttf: msbm10:style=LyX
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-It.otf: Source Code Pro:style=Italic
/usr/share/X11/fonts/Type1/c0633bt_.pfb: Bitstream Charter:style=Bold Italic
/usr/share/X11/fonts/Type1/c0649bt_.pfb: Bitstream Charter:style=Italic
/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Semibold.otf: Source Code Pro,Source Code Pro Semibold:style=Semibold,Regular
/usr/share/X11/fonts/Type1/c0632bt_.pfb: Bitstream Charter:style=Bold
/usr/share/fonts/lyx/cmr10.ttf: cmr10:style=LyX
/usr/share/X11/fonts/Type1/UTRG____.pfa: Utopia:style=Regular

What could be the issue?

I am using Sourcetrail in a X session forwarded over SSH (i.e. ssh myserver with ForwardX11 yes, and then run sourcetrail). Could this be the issue? The SSH client here is Fedora 26 (GNOME with Wayland), and the SSH server running Sourcetrail is RHEL 7.4.

/etc/fonts/conf.d/10-scale-bitmap-fonts.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

<match target="font">
  <test name="scalable" compare="eq">
    <bool>false</bool>
  </test>
  <edit name="pixelsizefixupfactor" mode="assign">
    <divide>
      <name target="pattern">pixelsize</name>
      <name target="font"   >pixelsize</name>
    </divide>
  </edit>
</match>
<match target="font">
  <test name="scalable" compare="eq">
    <bool>false</bool>
  </test>
  <edit name="scalingnotneeded" mode="assign">
    <and>
      <less>
        <name>pixelsizefixupfactor</name>
        <double>1.2</double>
      </less>
      <more>
        <name>pixelsizefixupfactor</name>
        <double>0.8</double>
      </more>
    </and>
  </edit>
</match>
<!--
  So far we determined the scale factor.  Now, check and if
  scaling is NOT desirable, just reset the scale factor to 1.0.
  -->
<match target="font">
  <test name="scalable" compare="eq">
    <bool>false</bool>
  </test>
  <test name="pixelsize" target="pattern" compare="less">
    <double>64</double>
  </test>
  <test name="hinting" compare="eq">
    <bool>true</bool>
  </test>
  <test name="scalingnotneeded" compare="eq">
    <bool>true</bool>
  </test>
  <edit name="pixelsizefixupfactor" mode="assign">
    <double>1.0</double>
  </edit>
</match>
<!--
  If we *are* going to scale, go ahead and do it.
  -->
<match target="font">
  <test name="scalable" compare="eq">
    <bool>false</bool>
  </test>
  <test name="pixelsizefixupfactor" compare="not_eq">
    <double>1.0</double>
  </test>
  <edit name="matrix" mode="assign">
    <times>
      <name>matrix</name>
      <matrix>
        <name>pixelsizefixupfactor</name> <double>0</double>
        <double>0</double> <name>pixelsizefixupfactor</name>
       </matrix>
    </times>
  </edit>
  <edit name="size" mode="assign">
    <divide>
      <name>size</name>
      <name>pixelsizefixupfactor</name>
    </divide>
  </edit>
</match>

</fontconfig>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions