On 2025/01/09 23:54, Kirill A. Korinsky wrote: > On Thu, 09 Jan 2025 22:17:58 +0100, > Kirill A. Korinsky <kir...@korins.ky> wrote: > > > > ports@, > > > > I'd like to import fonts/openmoji which brings SVG based color emoji fonts > > which works with our fontconfig which is built without PNG support. > > > > It works like this: > > > > openmoji $ fc-match emoji > > NotoColorEmoji.ttf: "Noto Color Emoji" "Regular" > > openmoji $ make install > > ===> Installing openmoji-15.1.0 from /build/packages/amd64/all/ > > openmoji-15.1.0: ok > > Updating font cache: ok > > openmoji $ fc-match emoji > > OpenMoji-color-colr0_svg.ttf: "OpenMoji Color" "Regular" > > openmoji $ > > > > restart your GTK application, and you have emoji in it. > > > > Tested with Dino (gtk4) on -current/amd64. > > > > Ok? > > > > martjin@ had pointed me that original port consumes CPU when a font is used. > > After some investigation I had noticed that using ttf with COLRv1 hasn't got > this issue. > > Here an updated tgz > > -- > wbr, Kirill
A few tweaks: - use font MODULES - include OpenMoji-black-glyf.ttf - tweak comment in files/90-openmoji-aliases.conf (it's freetype not fontconfig that is built without PNG support) - SYSCONFDIR refers to the directory from ports, when referring to a directory from base it should just use /etc. however, I don't really like font config being changed just from pkg_add'ing something, how about just showing the user how to link it themselves instead? diff --git a/fonts/openmoji/Makefile b/fonts/openmoji/Makefile index 4b1e359..71b0108 100644 --- a/fonts/openmoji/Makefile +++ b/fonts/openmoji/Makefile @@ -1,6 +1,9 @@ -COMMENT = SVG based open source emojis +COMMENT = SVG/COLR-based open source emoji fonts -DIST_TUPLE = github hfg-gmuend openmoji 15.1.0 . +MODFONT_FAMILY = openmoji +MODFONT_VERSION = 15.1.0 + +DIST_TUPLE = github hfg-gmuend openmoji ${MODFONT_VERSION} . CATEGORIES = fonts @@ -9,17 +12,17 @@ HOMEPAGE = https://openmoji.org/ # CC-BY-SA PERMIT_PACKAGE = Yes +MODULES = font + NO_BUILD = Yes NO_TEST = Yes -PKG_ARCH = * +MODFONT_FONTFILES = font/OpenMoji-color-colr1_svg/*.ttf \ + font/OpenMoji-black-glyf/*.ttf -do-install: +post-install: ${INSTALL_DATA_DIR} ${PREFIX}/share/openmoji ${INSTALL_DATA} ${FILESDIR}/90-openmoji-aliases.conf \ ${PREFIX}/share/openmoji - ${INSTALL_DATA_DIR} ${PREFIX}/share/fonts/openmoji - ${INSTALL_DATA} ${WRKSRC}/font/OpenMoji-color-colr1_svg/*.ttf \ - ${PREFIX}/share/fonts/openmoji .include <bsd.port.mk> diff --git a/fonts/openmoji/files/90-openmoji-aliases.conf b/fonts/openmoji/files/90-openmoji-aliases.conf index 8ba6215..5a4bc33 100644 --- a/fonts/openmoji/files/90-openmoji-aliases.conf +++ b/fonts/openmoji/files/90-openmoji-aliases.conf @@ -2,8 +2,10 @@ <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!-- - OpenBSD's fontconfig does not support PNG fonts. Set OpenMoji Color as the default emoji font. + This includes SVG and COLR and is supported by OpenBSD's + build of freetype which does not support embedded PNG + bitmaps as used in most other emoji fonts. --> <match> <test name="family"> diff --git a/fonts/openmoji/pkg/MESSAGE b/fonts/openmoji/pkg/MESSAGE new file mode 100644 index 0000000..2a5eb2a --- /dev/null +++ b/fonts/openmoji/pkg/MESSAGE @@ -0,0 +1,2 @@ +To use OpenMoji as your default system emoji font, + # ln -s ${PREFIX}/share/openmoji/90-openmoji-aliases.conf /etc/fonts/conf.d/ diff --git a/fonts/openmoji/pkg/PLIST b/fonts/openmoji/pkg/PLIST index b98f557..674daf6 100644 --- a/fonts/openmoji/pkg/PLIST +++ b/fonts/openmoji/pkg/PLIST @@ -1,6 +1,6 @@ share/fonts/ @fontdir share/fonts/openmoji/ +share/fonts/openmoji/OpenMoji-black-glyf.ttf share/fonts/openmoji/OpenMoji-color-colr1_svg.ttf share/openmoji/ share/openmoji/90-openmoji-aliases.conf -@sample ${SYSCONFDIR}/fonts/conf.d/90-openmoji-aliases.conf