Commit b014941e authored by Akira TAGOH's avatar Akira TAGOH

Add 20-ot-weight-to-fc.conf

Ruleset to liner-interpolate weight value in OT scale to FC scale.

Fixes fontconfig/fontconfig#215
parent 7637ce25
Pipeline #108140 failed with stage
in 10 minutes and 28 seconds
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<description>Convert weight in OpenType scaling to Fontconfig scaling</description>
<match>
<test name="otweight" compare="less">
<double>0</double>
</test>
<edit name="otweight" mode="assign">
<double>0</double>
</edit>
</match>
<match>
<test name="otweight" compare="more">
<double>1000</double>
</test>
<edit name="otweight" mode="assign">
<double>1000</double>
</edit>
</match>
<!-- simply convert to the symbol -->
<match>
<test name="otweight" compare="eq">
<double>1000</double>
</test>
<edit name="weight" mode="append">
<const>extrablack</const>
</edit>
</match>
<match>
<test name="otweight" compare="eq">
<double>900</double>
</test>
<edit name="weight" mode="append">
<const>black</const>
</edit>
</match>
<match>
<test name="otweight" compare="eq">
<double>800</double>
</test>
<edit name="weight" mode="append">
<const>extrabold</const>
</edit>
</match>
<match>
<test name="otweight" compare="eq">
<double>700</double>
</test>
<edit name="weight" mode="append">
<const>bold</const>
</edit>
</match>
<match>
<test name="otweight" compare="eq">
<double>600</double>
</test>
<edit name="weight" mode="append">
<const>demibold</const>
</edit>
</match>
<match>
<test name="otweight" compare="eq">
<double>500</double>
</test>
<edit name="weight" mode="append">
<const>medium</const>
</edit>
</match>
<match>
<test name="otweight" compare="eq">
<double>400</double>
</test>
<edit name="weight" mode="append">
<const>regular</const>
</edit>
</match>
<match>
<test name="otweight" compare="eq">
<double>380</double>
</test>
<edit name="weight" mode="append">
<const>book</const>
</edit>
</match>
<match>
<test name="otweight" compare="eq">
<double>350</double>
</test>
<edit name="weight" mode="append">
<const>demilight</const>
</edit>
</match>
<match>
<test name="otweight" compare="eq">
<double>300</double>
</test>
<edit name="weight" mode="append">
<const>light</const>
</edit>
</match>
<match>
<test name="otweight" compare="eq">
<double>200</double>
</test>
<edit name="weight" mode="append">
<const>extralight</const>
</edit>
</match>
<match>
<test name="otweight" compare="eq">
<double>100</double>
</test>
<edit name="weight" mode="append">
<const>thin</const>
</edit>
</match>
<match>
<test name="otweight" compare="eq">
<double>0</double>
</test>
<edit name="weight" mode="append">
<const>thin</const>
</edit>
</match>
<!-- liner interpolate -->
<match>
<test name="otweight" compare="more">
<double>900</double>
</test>
<edit name="weight" mode="append">
<lerp>
<name>otweight</name>
<range><double>900</double><double>1000</double></range>
<range><const>black</const><const>extrablack</const></range>
</lerp>
</edit>
<edit name="otweight" mode="delete"/>
</match>
<match>
<test name="otweight" compare="more">
<double>800</double>
</test>
<edit name="weight" mode="append">
<lerp>
<name>otweight</name>
<range><double>800</double><double>900</double></range>
<range><const>extrabold</const><const>black</const></range>
</lerp>
</edit>
<edit name="otweight" mode="delete"/>
</match>
<match>
<test name="otweight" compare="more">
<double>700</double>
</test>
<edit name="weight" mode="append">
<lerp>
<name>otweight</name>
<range><double>700</double><double>800</double></range>
<range><const>bold</const><const>extrabold</const></range>
</lerp>
</edit>
<edit name="otweight" mode="delete"/>
</match>
<match>
<test name="otweight" compare="more">
<double>600</double>
</test>
<edit name="weight" mode="append">
<lerp>
<name>otweight</name>
<range><double>600</double><double>700</double></range>
<range><const>demibold</const><const>bold</const></range>
</lerp>
</edit>
<edit name="otweight" mode="delete"/>
</match>
<match>
<test name="otweight" compare="more">
<double>500</double>
</test>
<edit name="weight" mode="append">
<lerp>
<name>otweight</name>
<range><double>500</double><double>600</double></range>
<range><const>medium</const><const>demibold</const></range>
</lerp>
</edit>
<edit name="otweight" mode="delete"/>
</match>
<match>
<test name="otweight" compare="more">
<double>400</double>
</test>
<edit name="weight" mode="append">
<lerp>
<name>otweight</name>
<range><double>400</double><double>500</double></range>
<range><const>regular</const><const>medium</const></range>
</lerp>
</edit>
<edit name="otweight" mode="delete"/>
</match>
<match>
<test name="otweight" compare="more">
<double>380</double>
</test>
<edit name="weight" mode="append">
<lerp>
<name>otweight</name>
<range><double>380</double><double>400</double></range>
<range><const>book</const><const>regular</const></range>
</lerp>
</edit>
<edit name="otweight" mode="delete"/>
</match>
<match>
<test name="otweight" compare="more">
<double>350</double>
</test>
<edit name="weight" mode="append">
<lerp>
<name>otweight</name>
<range><double>350</double><double>380</double></range>
<range><const>demilight</const><const>book</const></range>
</lerp>
</edit>
<edit name="otweight" mode="delete"/>
</match>
<match>
<test name="otweight" compare="more">
<double>300</double>
</test>
<edit name="weight" mode="append">
<lerp>
<name>otweight</name>
<range><double>300</double><double>350</double></range>
<range><const>light</const><const>demilight</const></range>
</lerp>
</edit>
<edit name="otweight" mode="delete"/>
</match>
<match>
<test name="otweight" compare="more">
<double>200</double>
</test>
<edit name="weight" mode="append">
<lerp>
<name>otweight</name>
<range><double>200</double><double>300</double></range>
<range><const>extralight</const><const>demilight</const></range>
</lerp>
</edit>
<edit name="otweight" mode="delete"/>
</match>
<match>
<test name="otweight" compare="more">
<double>100</double>
</test>
<edit name="weight" mode="append">
<lerp>
<name>otweight</name>
<range><double>100</double><double>200</double></range>
<range><const>thin</const><const>extralight</const></range>
</lerp>
</edit>
<edit name="otweight" mode="delete"/>
</match>
<match>
<test name="otweight" compare="more">
<double>0</double>
</test>
<edit name="weight" mode="append">
<const>thin</const>
</edit>
<edit name="otweight" mode="delete"/>
</match>
</fontconfig>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment