#1 Convert spec to new fonts packaging guidelines
Merged 2 years ago by hedayat. Opened 2 years ago by pnemade.
Unknown source rawhide  into  rawhide

file modified
+1
@@ -4,3 +4,4 @@

  /Scheherazade-2.010.zip

  /Scheherazade-2.020.zip

  /Scheherazade-2.100.zip

+ /ScheherazadeNew-3.300.zip

65-sil-scheherazade-new-fonts.conf sil-scheherazade-fonts-fontconfig.conf
file renamed
+5 -5
@@ -1,14 +1,14 @@

  <?xml version="1.0"?>

- <!DOCTYPE fontconfig SYSTEM "fonts.dtd">

+ <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">

  <fontconfig>

    <alias>

      <family>serif</family>

      <prefer>

-       <family>Scheherazade</family>

+       <family>Scheherazade New</family>

      </prefer>

    </alias>

    <alias>

-     <family>Scheherazade</family>

+     <family>Scheherazade New</family>

      <default>

        <family>serif</family>

      </default>
@@ -16,12 +16,12 @@

    <alias binding="same">

      <family>Monotype Naskh</family>

      <accept>

-       <family>Scheherazade</family>

+       <family>Scheherazade New</family>

      </accept>

    </alias>

    <match target="font">

      <test name="family" compare="eq">

-       <string>Scheherazade</string>

+       <string>Scheherazade New</string>

      </test>

      <edit name="matrix" mode="assign">

        <times>

Thanks for this PR. However, I was thinking if we should also register this font as 'Scheherazade' too. Because with this update, Scheherazade font will suddenly disappear from Fedora and if a document uses Scheherazade, it won't use this new font.

file modified
+46 -44
@@ -1,60 +1,63 @@

- %global fontname sil-scheherazade

- %global fontconf 65-%{fontname}.conf

- 

- Name:           %{fontname}-fonts

- Version:        2.100

- Release:        15%{?dist}

- Summary:        An Arabic script unicode font

+ %global projectname       scheherazade

+ BuildArch: noarch

+ 

+ Version:    3.300

+ Release:    1%{?dist}

+ URL:        https://software.sil.org/%{projectname}/

+ 

+ %global foundry           SIL

+ %global fontlicense       OFL-1.1

+ %global fontlicenses      OFL.txt

+ %global fontdocs          FONTLOG.txt README.txt OFL-FAQ.txt documentation/*

+ %global fontdocsex        %{fontlicenses}

+ 

+ %global fontfamily1        Scheherazade New

+ %global fontsummary1       An Arabic script unicode font

+ %global fontpkgheader1    %{expand:

+ Obsoletes: scheherazade-fonts < %{version}-%{release}

+ }

+ %global fonts1             *.ttf

+ %global fontconfs1         %{SOURCE1}

+ %global fontdescription1   %{expand:

+ Scheherazade, named after the heroine of the classic Arabian Nights tale, is

+ designed in a similar style to traditional typefaces such as Monotype Naskh,

+ extended to cover the full Unicode Arabic repertoire.

+ }

  

- License:        OFL

- URL:            https://software.sil.org/scheherazade/

- Source0:        https://software.sil.org/downloads/r/scheherazade/Scheherazade-%{version}.zip

- Source1:        %{name}-fontconfig.conf

- Source2:        %{fontname}.metainfo.xml

+ Source0:    https://software.sil.org/downloads/r/scheherazade/ScheherazadeNew-%{version}.zip

+ Source1:    65-%{fontpkgname1}.conf

  

- BuildArch:      noarch

- BuildRequires:  fontpackages-devel

- Requires:       fontpackages-filesystem

+ Name:       sil-scheherazade-fonts

+ Summary:    An Arabic script unicode font 

+ License:    OFL-1.1

  

  %description

- Scheherazade, named after the heroine of the classic Arabian Nights tale, is

- designed in a similar style to traditional typefaces such as Monotype Naskh,

- extended to cover the full Unicode Arabic repertoire.

+ %wordwrap -v common_description

  

- %prep

- %setup -q -n Scheherazade-%{version}

+ %fontpkg -a

  

+ %prep

+ %setup -q -n ScheherazadeNew-%{version}

+ rm -rf documentation/source documentation/pdf

+ %linuxtext FONTLOG.txt OFL.txt OFL-FAQ.txt README.txt documentation/DOCUMENTATION.txt documentation/assets/css/*

  

  %build

- for docfile in *.txt; do

-     fold -s $docfile > $docfile.new && \

-     sed -i "s|\r||g" $docfile.new && \

-     touch -r $docfile $docfile.new && \

-     mv $docfile.new $docfile

- done

+ %fontbuild -a

  

  %install

- install -m 0755 -d %{buildroot}%{_fontdir}

- install -m 0644 -p *.ttf %{buildroot}%{_fontdir}

- 

- install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \

-                    %{buildroot}%{_fontconfig_confdir}

+ %fontinstall -a

  

- install -m 0644 -p %{SOURCE1} \

-         %{buildroot}%{_fontconfig_templatedir}/%{fontconf}

- ln -s %{_fontconfig_templatedir}/%{fontconf} \

-       %{buildroot}%{_fontconfig_confdir}/%{fontconf}

+ %check

+ %fontcheck -a

  

- # Add AppStream metadata

- install -Dm 0644 -p %{SOURCE2} \

-         %{buildroot}%{_datadir}/appdata/%{fontname}.metainfo.xml

- 

- %_font_pkg -f %{fontconf} *.ttf

- %license OFL.txt

- %doc FONTLOG.txt README.txt OFL-FAQ.txt documentation/*

- %{_datadir}/appdata/%{fontname}.metainfo.xml

+ %fontfiles -a

  

  %changelog

+ * Sat Sep 03 2022 Parag Nemade <pnemade AT redhat DOT com> - 3.300-1

+ - Convert spec to new fonts packaging guidelines

+ - Update to new upstream release 3.300

+ - Upstream renamed font family to "Scheherazade New"

+ 

  * Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.100-15

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

  
@@ -152,4 +155,3 @@

  

  * Mon Sep 28 2009 Hedayat Vatankhah <hedayat@grad.com> - 1.001-1

  - Initial version

- 

@@ -1,17 +0,0 @@

- <?xml version="1.0" encoding="UTF-8"?>

- <!-- Copyright 2014 Parag Nemade <pnemade AT redhat DOT com> -->

- <component type="font">

-   <id>sil-scheherazade</id>

-   <metadata_license>CC-BY-3.0</metadata_license>

-   <name>Scheherazade</name>

-   <summary>An Arabic script unicode font</summary>

-   <description>

-     <p>

-       Scheherazade, named after the heroine of the classic Arabian Nights tale, is

-       designed in a similar style to traditional typefaces such as Monotype Naskh,

-       extended to cover the full Unicode Arabic repertoire.

-     </p>

-   </description>

-   <updatecontact>pnemade_at_redhat_dot_com</updatecontact>

-   <url type="homepage">http://scripts.sil.org/ArabicFonts</url>

- </component>

file modified
+1 -1
@@ -1,1 +1,1 @@

- 1eacddeee942adcb28280c7cb5e8cd39  Scheherazade-2.100.zip

+ SHA512 (ScheherazadeNew-3.300.zip) = 3565ede46d7d42171923546038a4cc3d6b74fd314097e77cf01402dfd2cf1d1840c37e380d5325fd9186f7e920c2f8f4034c0de036ccc4824ea70cbfd7cc9252

Update to new upstream release 3.300
Upstream renamed font family to "Scheherazade New"

rebased onto 477c9ad

2 years ago

Thanks for this PR. However, I was thinking if we should also register this font as 'Scheherazade' too. Because with this update, Scheherazade font will suddenly disappear from Fedora and if a document uses Scheherazade, it won't use this new font.

Well, I'm not sure details why upstream decided renaming though, there might be some reason upstream can't/don't want to keep using old name. Once renaming happened, strictly speaking, Scheherazade and Scheherazade New fonts should considered different fonts. That said, we sometimes have such fallback rule for metric compatible fonts. But I don't think we need it here because family name isn't that different and most applications should fallback properly if missing.
If you have any such documents and worrying about backward compatible issues, maybe good to try first.
We could consider adding something if any issues though, it may prevents migration of this renaming.

Thank you for the comment. I confess that I'm not very familiar with fontconfig fallback rules. Does it consider name similarity too? If that's the case, then it should be fine. I didn't know about it.

Yeah, I've not tested it. :P

Pull-Request has been merged by hedayat

2 years ago