• [gentoo-dev] [PATCH 1/5] font.eclass: introduce FONT_CONVERT_SFNT for c

    From Sam James@21:1/5 to All on Sat Oct 15 05:20:01 2022
    =x11-libs/pango-1.44 dropped support for old bitmap fonts. We can convert fonts from the legacy .bdf and .pcf formats into the OTB wrapper format
    using x11-apps/fonttosfnt.

    This commit adds FONT_CONVERT_SFNT which packages installing bitmap fonts
    can set to opt-in to conversion.

    Note that the font conversion isn't perfect -- it's good enough
    in many cases, but in some cases they may require tweaking
    via fontconfig to get pixel size right, antialiasing settings, ...

    Adds IUSE=+convert-sfnt to any ebuilds which set FONT_CONVERT_SFNT;
    enabled by default given discoverability of this issue may be difficult
    and presumably any font package enabling FONT_CONVERT_SFNT will be
    useless without it anyway.

    See also https://fedoraproject.org/wiki/BitmapFontConversion.

    Bug: https://bugs.gentoo.org/698922
    Thanks-to: Kerin Millar <[email protected]>
    Signed-off-by: Sam James <[email protected]>
    ---
    eclass/font.eclass | 35 +++++++++++++++++++++++++++++++++++
    1 file changed, 35 insertions(+)

    diff --git a/eclass/font.eclass b/eclass/font.eclass
    index 83636ac3fed5..4b7021ee0599 100644
    --- a/eclass/font.eclass
    +++ b/eclass/font.eclass
    @@ -46,6 +46,12 @@ FONTDIR=${FONTDIR:-/usr/share/fonts/${FONT_PN}}
    # Array containing fontconfig conf files to install.
    FONT_CONF=( "" )

    +# @ECLASS_VARIABLE: FONT_CONVERT_SFNT
    +# @DEFAULT_UNSET
    +# @DESCRIPTION:
    +# Determines whether detected BDF and PCF font files should be converted
    +# to an SFNT wrapper, for use with newer Pango.
    +
    if [[ ${CATEGORY}/${PN} != media-fonts/encodings ]]; then
    IUSE="X"
    BDEPEND="X? (
    @@ -54,6 +60,31 @@ if [[ ${CATEGORY}/${PN} != media-fonts/encodings ]]; then
    )"
    fi

    +if [[ -n ${FONT_CONVERT_SFNT} ]] ; then
    + IUSE+=" +convert-sfnt"
    + BDEPEND+=" convert-sfnt? ( x11-apps/fonttosfnt )"
    +fi
    +
    +# @FUNCTION: font_convert_sfnt
    +# @DESCRIPTION:
    +# Converts .bdf and .pcf fonts detected within ${ED} to the OTB
  • From Sam James@21:1/5 to All on Sat Oct 15 05:20:02 2022
    Bug: https://bugs.gentoo.org/698922
    Signed-off-by: Sam James <[email protected]>
    ---
    profiles/use.desc | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/profiles/use.desc b/profiles/use.desc
    index d7e841f80df6..cdf98b916af1 100644
    --- a/profiles/use.desc
    +++ b/profiles/use.desc
    @@ -45,6 +45,7 @@ cjk - Add support for Multi-byte character languages (Chinese, Japanese, Korean)
    clamav - Add support for Clam AntiVirus software (usually with a plugin)
    colord - Support color management using x11-misc/colord
    connman - Add support for net-misc/connman
    +convert-sfnt - Convert BDF and PCF bitmap fonts to OTB wrapper format
    coreaudio - Build the CoreAudio driver on Mac OS X systems
    cracklib - Support for cracklib strong password checking
    crypt - Add support for encryption -- using mcrypt or gpg where applicable
    --
    2.38.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Sat Oct 15 05:40:01 2022
    On 15 Oct 2022, at 04:09, Sam James <[email protected]> wrote:

    =x11-libs/pango-1.44 dropped support for old bitmap fonts. We can convert
    fonts from the legacy .bdf and .pcf formats into the OTB wrapper format
    using x11-apps/fonttosfnt.

    This commit adds FONT_CONVERT_SFNT which packages installing bitmap fonts
    can set to opt-in to conversion.

    Note that the font conversion isn't perfect -- it's good enough
    in many cases, but in some cases they may require tweaking
    via fontconfig to get pixel size right, antialiasing settings, ...

    Adds IUSE=+convert-sfnt to any ebuilds which set FONT_CONVERT_SFNT;
    enabled by default given discoverability of this issue may be difficult
    and presumably any font package enabling FONT_CONVERT_SFNT will be
    useless without it anyway.

    See also https://fedoraproject.org/wiki/BitmapFontConversion.

    Bug: https://bugs.gentoo.org/698922
    Thanks-to: Kerin Millar <[email protected]>
    Signed-off-by: Sam James <[email protected]>
    ---
    eclass/font.eclass | 35 +++++++++++++++++++++++++++++++++++
    1 file changed, 35 insertions(+)

    diff --git a/eclass/font.eclass b/eclass/font.eclass
    index 83636ac3fed5..4b7021ee0599 100644
    --- a/eclass/font.eclass
    +++ b/eclass/font.eclass
    [snip]

    +# @FUNCTION: font_convert_sfnt
    +# @DESCRIPTION:
    +# Converts .bdf and .pcf fonts detected within ${ED} to the OTB wrapper format
    +# using x11-apps/fonttosfnt. Handles optional .gz extension. +font_convert_sfnt() {
    + local file tmpfile
    +
    + while IFS= read -rd '' file; do
    + if [[ ${file} != *.gz ]] ; then

    ==, which I'll fix locally.


    -----BEGIN PGP SIGNATURE-----

    iNUEARYKAH0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCY0oqJV8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MAAKCRBzhAn1IN+R kGn6AQCMw0LPSw/XAYj7MKQ6QgWEX0NoH0XNRSaqxQ7SmfRCBgD/VbO77ohKfiJP u0bJQ2bROTUmBC4QEirVd8PK6RakMwU=
    =WBQJ
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Sat Oct 15 11:10:01 2022
    On Sat, 15 Oct 2022, Sam James wrote:

    +convert-sfnt - Convert BDF and PCF bitmap fonts to OTB wrapper format

    Sorry for the bikeshedding, but could we have a name that indicates what
    this global flag is about? Maybe something starting with "font" which
    would at least point to the general area.

    Ulrich

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmNKdwQPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uNnoH/02Y09Rb4LFpKo6jBohbvsL8A4UIJ7SbAKl+ 9EP88mWAS9pa3Hj0AMfG8kiJ68v2hDyEYW4ukQ/2ni1NYgQ4/ln0K0MAQW2VV5iX K7tX9XevKmMQuMNZGpDdkEeFB0quuNS85kFqcEuPiiaHjYNY3Dzu8agmehwZWqrd Wg5lZRuHnUcIfRWULs7zhG9Iv1mKBs6XqEo4foJfbRf372Za8dMlGSOZ8DFFUcFF qvFZ664OVpR5TRX/e7iAiub/icxnCBc6tVpzNxJ/iwwFFbDLdjGeKPefQp5euC8S uN8QtJflYob5+VLS3cXxvHp0b3/ohYVzpEFlZrGrsXRM6OFAjOQ=
    =ivxh
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mart Raudsepp@21:1/5 to All on Mon Oct 17 09:00:01 2022
    Ühel kenal päeval, L, 15.10.2022 kell 11:01, kirjutas Ulrich Mueller:
    On Sat, 15 Oct 2022, Sam James wrote:

    +convert-sfnt - Convert BDF and PCF bitmap fonts to OTB wrapper
    format

    Sorry for the bikeshedding, but could we have a name that indicates
    what
    this global flag is about? Maybe something starting with "font" which
    would at least point to the general area.

    Also I don't think it actually converts it in the sense that I would
    think when looking at the USE flag, but rather has the package ship it
    in an OpenType container AS WELL for pango to work with it?

    Mart

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Sun Oct 30 15:00:01 2022
    On 17 Oct 2022, at 07:53, Mart Raudsepp <[email protected]> wrote:

    Ühel kenal päeval, L, 15.10.2022 kell 11:01, kirjutas Ulrich Mueller:
    On Sat, 15 Oct 2022, Sam James wrote:

    +convert-sfnt - Convert BDF and PCF bitmap fonts to OTB wrapper
    format

    Sorry for the bikeshedding, but could we have a name that indicates
    what
    this global flag is about? Maybe something starting with "font" which
    would at least point to the general area.

    Also I don't think it actually converts it in the sense that I would
    think when looking at the USE flag, but rather has the package ship it
    in an OpenType container AS WELL for pango to work with it?

    Mart


    Okay, what about USE=opentype-compat?

    -----BEGIN PGP SIGNATURE-----

    iNUEARYKAH0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCY16CIl8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MAAKCRBzhAn1IN+R kG+hAQDHrpTMa5JCC87YEcXYFochwzEAZQ1EhqQSFrit6NIuogD/fnrHLLzzwa7U yQW940MbUoRf43OTOviSh1HRxhqutQI=
    =HZcG
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)