Skip to content

Commit

Permalink
Make more changes to fontconfig, clean install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
esoleyman committed Apr 18, 2022
1 parent 8cd5293 commit f0b3bca
Show file tree
Hide file tree
Showing 2 changed files with 272 additions and 40 deletions.
301 changes: 267 additions & 34 deletions 65-fonts-syriac.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,60 +13,293 @@
place of preferred_syriac_font.
-->

<!--
East Syriac Fonts:
<fontconfig>
<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
<its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
</its:rules>

<description>Syriac-specific font configuration</description>

<!-- Default font -->
<match>
<test compare="contains" name="lang">
<string>syr</string>
</test>
<edit mode="prepend" name="family">
<string>preferred_syriac_font</string>
</edit>
</match>

<!-- Font sizing -->
<!--
Syriac letters have a smaller body relative to the diacritics above and
below them, as such the most common elements are smaller to others.
Because the height of the fonts needs ot fit within the body size,
Syriac looks smaller than latin at the same point size.
Default pixelsize is 1.8
-->
<match target="font">
<test name="lang" compare="contains">
<string>syr</string>
</test>
<edit name="pixelsize" mode="assign">
<times><name>pixelsize</name>, <double>1.8</double></times>
</edit>
</match>


<!-- syriac_east class -->
<!--
- East Syriac Adiabene
- East Syriac Ctesiphon
Serto:
-->
<alias binding="same">
<family>East Syriac Adiabene</family>
<accept><family>syriac_east</family></accept>
</alias>
<alias binding="same">
<family>East Syriac Ctesiphon</family>
<accept><family>syriac_east</family></accept>
</alias>

<!-- syriac_serto class -->
<!--
- Serto Batnan
- Serto Jerusalem
- Serto Kharput
- Serto Malankara
- Serto Mardin
- Serto Urhoy
-->
<alias binding="same">
<family>Serto Batnan</family>
<accept><family>syriac_serto</family></accept>
</alias>
<alias binding="same">
<family>Serto Jerusalem</family>
<accept><family>syriac_serto</family></accept>
</alias>
<alias binding="same">
<family>Serto Kharput</family>
<accept><family>syriac_serto</family></accept>
</alias>
<alias binding="same">
<family>Serto Malankara</family>
<accept><family>syriac_serto</family></accept>
</alias>
<alias binding="same">
<family>Serto Mardin</family>
<accept><family>syriac_serto</family></accept>
</alias>
<alias binding="same">
<family>Serto Urhoy</family>
<accept><family>syriac_serto</family></accept>
</alias>

Estrangelo:
<!-- syriac_estrangelo -->
<!--
- Estrangelo Antioch
- Estrangelo Edessa
- Estrangelo Midyat
- Estrangelo Nisibin
- Estrangelo QenNeshrin
- Estrangelo Talada
- Estrangelo TurAbdin
-->
-->
<alias binding="same">
<family>Estrangelo Antioch</family>
<accept><family>syriac_estrangelo</family></accept>
</alias>
<alias binding="same">
<family>Estrangelo Edessa</family>
<accept><family>syriac_estrangelo</family></accept>
</alias>
<alias binding="same">
<family>Estrangelo Midyat</family>
<accept><family>syriac_estrangelo</family></accept>
</alias>
<alias binding="same">
<family>Estrangelo Nisibin</family>
<accept><family>syriac_estrangelo</family></accept>
</alias>
<alias binding="same">
<family>Estrangelo QenNeshrin</family>
<accept><family>syriac_estrangelo</family></accept>
</alias>
<alias binding="same">
<family>Estrangelo Talada</family>
<accept><family>syriac_estrangelo</family></accept>
</alias>
<alias binding="same">
<family>Estrangelo TurAbdin</family>
<accept><family>syriac_estrangelo</family></accept>
</alias>

<fontconfig>
<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
<its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
</its:rules>
<!-- Font ordering per class -->

<description>Syriac specific font configuration</description>
<!-- East Syriac -->
<alias binding="same">
<family>syriac_east</family>
<accept>
<family>East Syriac Adiabene</family>
<family>East Syriac Ctesiphon</family>
</accept>
</alias>

<match>
<test compare="contains" name="lang">
<string>syr</string>
</test>
<edit mode="prepend" name="family">
<string>preferred_syriac_font</string>
</edit>
</match>
<!-- Serto -->
<alias binding="same">
<family>syriac_serto</family>
<accept>
<family>Serto Batnan</family>
<family>Serto Urhoy</family>
<family>Serto Jerusalem</family>
<family>Serto Kharput</family>
<family>Serto Mardin</family>
<family>Serto Malankara</family>
</accept>
</alias>

<!-- Font sizing -->
<!--
Syriac letters have a smaller body relative to the diacritics above and
below them, as such the most common elements are smaller to others.
Because the height of the fonts needs ot fit within the body size,
Syriac looks smaller than latin at the same point size.
<!-- Estrangelo -->
<alias binding="same">
<family>syriac_estrangelo</family>
<accept>
<family>Estrangelo Edessa</family>
<family>Estrangelo Nisibin</family>
<family>Estrangelo Talada</family>
<family>Estrangelo TurAbdin</family>
<family>Estrangelo QenNeshrin</family>
<family>Estrangelo Antioch</family>
<family>Estrangelo Midyat</family>
</accept>
</alias>

Default pixelsize is 2.0
-->
<match target="font">
<test name="lang" compare="contains">
<string>syr</string>
</test>
<edit name="pixelsize" mode="assign">
<times><name>pixelsize</name>, <double>2.0</double></times>
</edit>
<!-- Register the fonts -->

<!-- East Syriac -->
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>East Syriac Adiabene</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>East Syriac Ctesiphon</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>

<!-- Serto -->
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>Serto Batnan</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>Serto Urhoy</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>Serto Jerusalem</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>Serto Kharput</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>Serto Mardin</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>Serto Malankara</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>

<!-- Estrangelo -->
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>Estrangelo Edessa</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>Estrangelo Nisibin</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>Estrangelo Talada</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>Estrangelo QenNeshrin</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>Estrangelo TurAbdin</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>Estrangelo Antioch</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>
<match target="scan">
<test name="family" compare="eq" ignore-blanks="true">
<string>Estrangelo Midyat</string>
</test>
<edit name="foundry">
<string>meltho</string>
</edit>
</match>

</fontconfig>
11 changes: 5 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

basedir="${PWD}" # Working directory that this script resides in
fonts_dir="$basedir/meltho-fonts" # Meltho fonts reside here
font_files=`ls $fonts_dir/*` # List of Meltho fonts

user_fonts_dir="$HOME/.fonts" # User installed fonts directory
user_fonts_dir="$HOME/.local/share/fonts" # User installed fonts directory
user_fc_dir="$HOME/.config/fontconfig/conf.d" # User installed fontconfig directory
user_fc_file="65-fonts-syriac.conf" # Keep the fontconfig convention

Expand Down Expand Up @@ -53,7 +52,7 @@ printf " 3) East Syriac\n\n"

printf " Choice: "

read style_script
read -r style_script

case $style_script in
1) preferred_style=$estrangelo_font ;;
Expand All @@ -69,16 +68,16 @@ else
printf " [-] %s\n" "Failed to create directory: $user_fc_dir"
fi

fc_file=`cat $basedir/$user_fc_file`
printf "$fc_file" | sed -e "s/preferred_syriac_font/${preferred_style}/g" > "$user_fc_dir/$user_fc_file"
fc_file=$(cat "$basedir/$user_fc_file")
printf '%s' "$fc_file" | sed -e "s/preferred_syriac_font/${preferred_style}/g" > "$user_fc_dir/$user_fc_file"
printf " [+] Wrote fontconfig file\n\n"


## FONTCONFIG CACHE UPDATE
printf "3. Updating fontconfig cache\n"

# Force fontconfig to update it's cache
`fc-cache -f`
fc-cache -f

printf "\n4. Installation Complete"

Expand Down

0 comments on commit f0b3bca

Please sign in to comment.