Skip to content

Commit

Permalink
More aliases tuning.
Browse files Browse the repository at this point in the history
  • Loading branch information
dumol committed Mar 24, 2021
1 parent 541fbe1 commit 220fda0
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 104 deletions.
8 changes: 5 additions & 3 deletions common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
* or of special type (Dingbats, Symbol). -->

<!-- Avant Garde, Century Gothic, etc.
Century Gothic used on: https://e.foundation. -->
Century Gothic used on: https://www.nationalgeographic.com (fallback),
https://e.foundation. -->
<include prefix="xdg">fontconfig/common/urw-gothic.conf</include>

<!-- Bitter. An open-source font frequently used for the web.
Expand Down Expand Up @@ -64,7 +65,7 @@

<!-- Trebuchet MS. TTF version from the googlefontdirectory repo is to be
used on low DPI screens. Latest version only for high DPI screens.
Used on: https://www.nih.gov/ (fallback). -->
Used on: https://www.lidl.com, https://www.nih.gov (fallback). -->
<include prefix="xdg">fontconfig/common/cabin.conf</include>

<!-- End of list of fonts perfectly hinted at small sizes. -->
Expand Down Expand Up @@ -93,7 +94,8 @@
<include prefix="xdg">fontconfig/common/garamond-libre.conf</include>

<!-- Gill Sans, Gill Sans MT.
Used on: https://www.biorxiv.org. -->
Used on: https://www.biorxiv.org, https://www.nationalgeographic.com
(fallback). -->
<include prefix="xdg">fontconfig/common/gillius-adf-no2.conf</include>


Expand Down
1 change: 1 addition & 0 deletions common/cinzel-decorative.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<family>Cinzel ExtraBold</family>
</prefer>
</alias>

<alias binding="same">
<family>Copperplate Gothic</family>
<prefer>
Expand Down
4 changes: 0 additions & 4 deletions common/urw-fallback-specifics.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ This file is used to alias/map previous versions of font families from (URW)++
to similar/metric-compatible font families - in this case as original PostScript
fonts (as specifics).
NOTE: These mappings are already part of fontconfig's config files by default.
We are keeping this file just to be complete, or if some distribution
needs it in some special case.
Most likely this aliasing/mapping will be useful for people who:
* have documents referencing older versions of the (URW)++ fonts, and need to
map their similar/metric-compatible fonts via generic font names
Expand Down
5 changes: 4 additions & 1 deletion fonts.conf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@
<!-- Settings and aliases for low DPI screens, covering "web safe" fonts.
Using <accept> for aliases doesn't work for Chromium. FIXME
Firefox doesn't load local fonts for some sites, e.g. on
https://e.foundation (both Century Gothic and Font Awesome). FIXME -->
https://e.foundation (both Century Gothic and Font Awesome). FIXME
WebKitGTK uses the default Sans alias for missing fonts. FIXME
WebKitGTK uses the same sizes for serif / sans / monospace. FIXME -->
<include prefix="xdg">fontconfig/lowdpi.conf</include>
<!-- Disables antialiasing for fonts perfectly hinted at specific sizes. -->
<include prefix="xdg">fontconfig/pixelperfect.conf</include>
Expand Down Expand Up @@ -96,6 +98,7 @@
To check how probable is for a font to be present on mainstream OS'es:
https://www.cssfontstack.com/
https://lonewolfonline.net/web-safe-font-list/
https://archive.is/20130112220820/www.codestyle.org/css/font-family/sampler-MacResults.shtml
To check/calculate DPI:
https://www.sven.de/dpi/
Expand Down
46 changes: 16 additions & 30 deletions hinting.conf
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,6 @@
</edit>
</match>

<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
<string>CamingoCode</string>
</test>
<edit name="hintstyle" mode="assign">
<const>hintfull</const>
</edit>
</match>

<!-- Hintfull distorts lower case letters at around 16 pt. -->
<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
Expand Down Expand Up @@ -134,9 +125,10 @@
</edit>
</match>

<!-- Distorted with hintfull. -->
<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
<string>Dark Courier</string>
<string>DejaVu Serif</string>
</test>
<edit name="hintstyle" mode="assign">
<const>hintslight</const>
Expand All @@ -145,39 +137,24 @@

<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
<string>Droid Sans</string>
</test>
<edit name="hintstyle" mode="assign">
<const>hintfull</const>
</edit>
</match>
<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
<string>Droid Sans Mono</string>
</test>
<edit name="hintstyle" mode="assign">
<const>hintfull</const>
</edit>
</match>
<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
<string>Droid Serif</string>
<string>EB Garamond</string>
</test>
<edit name="hintstyle" mode="assign">
<const>hintfull</const>
</edit>
</match>

<!-- Distorted with hintfull. -->
<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
<string>EB Garamond</string>
<string>Inconsolata</string>
</test>
<edit name="hintstyle" mode="assign">
<const>hintfull</const>
<const>hintslight</const>
</edit>
</match>

<!-- Sligtly worse with hintfull. -->
<!-- Slightly worse with hintfull. -->
<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
<string>Garamond Libre</string>
Expand Down Expand Up @@ -295,6 +272,15 @@
</edit>
</match>

<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
<string>Noto Mono</string>
</test>
<edit name="hintstyle" mode="assign">
<const>hintfull</const>
</edit>
</match>

<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
<string>Oswald</string>
Expand Down
45 changes: 23 additions & 22 deletions lowdpi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,32 @@
</match>


<!-- Aliases for the generic W3C font families.
Not constrained by metrics here, let's spice things up... -->
<!-- Ordered not only by similarity, but also by the number of
pixel-perfect glyphs to be rendered flawlessly at small sizes. -->
<!-- Aliases for the generic W3C font families. Ideally should match the
metrics of the main OS'es generics: Helvetica / Courier / Times on
macOS and Arial / Times New Roman / Courier New on Windows. -->
<alias binding="strong">
<family>serif</family>
<prefer>
<family>PT Serif</family>
<family>Liberation Serif</family>
<family>PT Serif</family>
<family>DejaVu Serif</family>
</prefer>
</alias>
<alias binding="strong">
<family>sans-serif</family>
<prefer>
<family>Liberation Sans</family>
<family>Ubuntu</family>
<family>PT Sans</family>
<family>Ubuntu</family>
</prefer>
</alias>
<alias binding="strong">
<family>monospace</family>
<prefer>
<!-- Liberation Mono's metrics match Courier / Courier New, and it
also has italics, but its default line spacing is bad. FIXME-->
<family>PT Mono</family>
<family>Liberation Mono</family>
<family>Noto Mono</family>
<family>Ubuntu Mono</family>
</prefer>
</alias>
Expand All @@ -71,7 +71,7 @@
<alias binding="strong">
<family>fantasy</family>
<prefer>
<family>Cinzel ExtraBold</family>
<family>Lobster Two</family>
</prefer>
</alias>

Expand Down Expand Up @@ -109,31 +109,32 @@
</prefer>
</alias>

<!-- Aliases used to target the macOS UI font. Maximum legibility here. -->
<!-- Aliases used to target the macOS UI font. Hijacked for our UI font. -->
<alias binding="strong">
<family>-apple-system</family>
<prefer>
<family>Liberation Sans</family>
<family>PT Sans</family>
</prefer>
</alias>
<alias binding="strong">
<family>-webkit-system-font</family>
<prefer>
<family>Liberation Sans</family>
<family>PT Sans</family>
</prefer>
</alias>
<alias binding="strong">
<family>BlinkMacSystemFont</family>
<prefer>
<family>Liberation Sans</family>
<family>PT Sans</family>
</prefer>
</alias>


<!-- Metrically-identical replacements. -->

<!-- Andale Mono, Source Code Pro, Droid Sans Mono.
Andale Mono used on https://theintercept.com (fallback). -->
<!-- Andale Mono, Source Code Pro, Droid Sans Mono, Noto Sans Mono.
Andale Mono used on https://theintercept.com (fallback).
Source Code Pro used on https://www.vice.com. -->
<include prefix="xdg">fontconfig/lowdpi/noto-mono.conf</include>

<!-- Bitstream Vera Serif -->
Expand Down Expand Up @@ -171,15 +172,14 @@
https://time.com (fallback). -->
<include prefix="xdg">fontconfig/lowdpi/pt-sans-narrow.conf</include>

<!-- Georgia, Georgia Pro. Slightly larger and w/o the old-style figures,
but much better suited than Liberation Serif or DejaVu Serif.
<!-- Georgia, Georgia Pro. Similar metrics with even higher x-height, but
no old-style figures. More similar than Liberation/DejaVu Serif though.
Georgia used on many sites, e.g. https://www.washingtonpost.com.
PT Serif used on https://time.com.-->
PT Serif used on https://time.com. -->
<include prefix="xdg">fontconfig/lowdpi/pt-serif.conf</include>

<!-- Geneva. This is Wine's Tahoma. Bold font is problematic at some sizes.
Tahoma is used on https://web.telegram.org,
https://theintercept.com (fallback).
Tahoma used on many sites, e.g. https://web.telegram.org.
Geneva used on https://news.ycombinator.com/ (fallback). -->
<include prefix="xdg">fontconfig/lowdpi/tahoma.conf</include>

Expand All @@ -192,14 +192,15 @@
<!-- Proxima Nova. Most successfull commercial font on the web. There's no
open-source font with perfect hinting to replace it. To avoid falling
back to default sans-serif, let's give Cabin a bit more use...
Proxima Nova used on: https://abcnews.go.com, https://duckduckgo.com.
Proxima Nova Cond used on https://gizmodo.com -->
Proxima Nova used on: https://www.cnbc.com, https://duckduckgo.com.
Proxima Nova Cond used on https://gizmodo.com. -->
<include prefix="xdg">fontconfig/lowdpi/cabin.conf</include>

<!-- Segoe UI, Segoe, Lucida Sans/Grande, Cantarell.
Segoe UI used on https://www.microsoft.com, https://msn.com, etc.
Segoe used on https://outlook.live.com.
Lucida Grande used on https://arxiv.org. -->
Lucida Grande used on https://telegram.org, https://arxiv.org.
Lucida Sans Unicode used on https://telegram.org (fallback). -->
<include prefix="xdg">fontconfig/lowdpi/pt-sans.conf</include>

<!-- SFMono-Regular. Sets best option for GitHub's default code font. -->
Expand Down
8 changes: 0 additions & 8 deletions lowdpi/luculent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,4 @@
<family>monospace</family>
</default>
</alias>

<!-- Font substitution rules -->
<alias binding="same">
<family>SFMono-Regular</family>
<prefer>
<family>Luculent</family>
</prefer>
</alias>
</fontconfig>
7 changes: 7 additions & 0 deletions lowdpi/noto-mono.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
</prefer>
</alias>

<alias binding="same">
<family>Noto Sans Mono</family>
<prefer>
<family>Noto Mono</family>
</prefer>
</alias>

<alias binding="same">
<family>Source Code Pro</family>
<prefer>
Expand Down
Loading

0 comments on commit 220fda0

Please sign in to comment.