diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-11-20 07:02:03 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-11-20 07:02:03 +0000 |
commit | c4f077d9f57bf57fcded75904bf512075191d2d2 (patch) | |
tree | 028f6c50f859c521d2b2093e314e95e4f5a8e98a /eclass | |
parent | 5d0c0ffd63620a4db788484bd36ab92b76e7891b (diff) |
gentoo auto-resync : 20:11:2022 - 07:02:03
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 37507 -> 37514 bytes | |||
-rw-r--r-- | eclass/font.eclass | 35 | ||||
-rw-r--r-- | eclass/xorg-3.eclass | 8 |
3 files changed, 42 insertions, 1 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex 15d67e06f3c9..636a7a0c4fc5 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/font.eclass b/eclass/font.eclass index 0196755ce3e1..e772409fe201 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_OPENTYPE_COMPAT +# @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_OPENTYPE_COMPAT} ]] ; then + IUSE+=" +opentype-compat" + BDEPEND+=" opentype-compat? ( x11-apps/fonttosfnt )" +fi + +# @FUNCTION: font_wrap_opentype_compat +# @DESCRIPTION: +# Converts .bdf and .pcf fonts detected within ${ED} to the OTB wrapper format +# using x11-apps/fonttosfnt. Handles optional .gz extension. +font_wrap_opentype_compat() { + local file tmpfile + + while IFS= read -rd '' file; do + if [[ ${file} == *.gz ]] ; then + tmpfile=${file%.*} + + gzip -cd -- "${file}" > "${tmpfile}" \ + && fonttosfnt -v -o "${file%.*}.otb" -- "${tmpfile}" \ + && rm -- "${tmpfile}" + else + fonttosfnt -v -o "${file%.*}.otb" -- "${file}" + fi || ! break + done < <(find "${ED}" \( -name '*.bdf' -o -name '*.bdf.gz' -o -name '*.pcf' -o -name '*.pcf.gz' \) -type f ! -type l -print0) || die +} + # @FUNCTION: font_xfont_config # @DESCRIPTION: # Generate Xorg font files (mkfontscale/mkfontdir). @@ -150,6 +181,10 @@ font_pkg_setup() { font_src_install() { local dir suffix commondoc + if [[ -n ${FONT_OPENTYPE_COMPAT} ]] && in_iuse opentype-compat && use opentype-compat ; then + font_wrap_opentype_compat + fi + if [[ $(declare -p FONT_S 2>/dev/null) == "declare -a"* ]]; then # recreate the directory structure if FONT_S is an array for dir in "${FONT_S[@]}"; do diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass index e120d23efd4f..0d35c0a8ebf8 100644 --- a/eclass/xorg-3.eclass +++ b/eclass/xorg-3.eclass @@ -463,7 +463,13 @@ xorg-3_src_install() { # Don't install libtool archives (even for modules) find "${D}" -type f -name '*.la' -delete || die - [[ -n ${FONT} ]] && remove_font_metadata + if [[ -n ${FONT} ]] ; then + if [[ -n ${FONT_OPENTYPE_COMPAT} ]] && in_iuse opentype-compat && use opentype-compat ; then + font_wrap_opentype_compat + fi + + remove_font_metadata + fi } # @FUNCTION: xorg-3_pkg_postinst |