diff options
-rw-r--r-- | eclass/font.eclass | 35 | ||||
-rw-r--r-- | eclass/xorg-3.eclass | 8 | ||||
-rw-r--r-- | media-fonts/font-misc-misc/font-misc-misc-1.1.2-r3.ebuild | 12 | ||||
-rw-r--r-- | profiles/arch/hppa/use.mask | 4 | ||||
-rw-r--r-- | profiles/use.desc | 1 |
5 files changed, 59 insertions, 1 deletions
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 diff --git a/media-fonts/font-misc-misc/font-misc-misc-1.1.2-r3.ebuild b/media-fonts/font-misc-misc/font-misc-misc-1.1.2-r3.ebuild new file mode 100644 index 000000000000..5f3bd3cf022e --- /dev/null +++ b/media-fonts/font-misc-misc/font-misc-misc-1.1.2-r3.ebuild @@ -0,0 +1,12 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +XORG_PACKAGE_NAME="misc-misc" +FONT_OPENTYPE_COMPAT=1 +inherit xorg-3 + +DESCRIPTION="X.Org miscellaneous fonts" + +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris" +IUSE="nls" diff --git a/profiles/arch/hppa/use.mask b/profiles/arch/hppa/use.mask index 83ae1d1951f6..171fb2e333a7 100644 --- a/profiles/arch/hppa/use.mask +++ b/profiles/arch/hppa/use.mask @@ -7,6 +7,10 @@ # NOTE: When masking a USE flag due to missing keywords, please file a keyword # request bug for the hppa arch. +# Sam James <sam@gentoo.org> (2022-10-15) +# x11-apps/fonttosfnt is not keyworded here +opentype-compat + # Matt Turner <mattst88gentoo.org> (2022-02-21) # app-crypt/tpm2-tss is not keyworded here tpm diff --git a/profiles/use.desc b/profiles/use.desc index d7e841f80df6..e82b7295be15 100644 --- a/profiles/use.desc +++ b/profiles/use.desc @@ -227,6 +227,7 @@ openal - Add support for the Open Audio Library openexr - Support for the OpenEXR graphics file format opengl - Add support for OpenGL (3D graphics) openmp - Build support for the OpenMP (support parallel computing), requires >=sys-devel/gcc-4.2 built with USE="openmp" +opentype-compat - Convert BDF and PCF bitmap fonts to OTB wrapper format opus - Enable Opus audio codec support oracle - Enable Oracle Database support orc - Use dev-lang/orc for just-in-time optimization of array operations |