On Tue, May 09, 2023 at 01:49:16PM +0100, Stuart Henderson wrote:
> After a discussion with phessler, here's a diff which adjusts
> font.port.mk (MODULES=font) so that, when FONTTYPES is not specified
> and both ttf and otf files are present, the otf files are used instead
> of ttf. (the Previous default was to only use ttf, anything else
> needed explicit setting).
> 
> This currently only changes the files installed by one font
> using the module (fonts/jaldi) though would have also changed
> atkinson-hyperlegible if it hadn't been adjusted recently.
> We could either change jaldi to set FONTTYPES=ttf, or switch
> to otf and update the plist, I opted for the latter.
> 
> (the "&& break" is to stop after otf if any such files are copied).
> 
> any comments/ok?
>

ok matthieu@ FWIW

In the atkinson-hyperlegible case, switching FONT_DISTSUBDIR was also
needed as the OTF and TTF fonts are not in the same subdir of the
distfile. So the porter needs to draw some attention. 

And I discovered recently that one can also use EXTRACT_FILES to
extract only the useful part of the distfile.  This could be used
there to save a few I/O

> 
> Index: infrastructure/mk/font.port.mk
> ===================================================================
> RCS file: /cvs/ports/infrastructure/mk/font.port.mk,v
> retrieving revision 1.4
> diff -u -p -r1.4 font.port.mk
> --- infrastructure/mk/font.port.mk    4 Nov 2016 15:44:14 -0000       1.4
> +++ infrastructure/mk/font.port.mk    9 May 2023 12:42:37 -0000
> @@ -15,12 +15,17 @@ PKGNAME ?=        ${TYPEFACE}-${VERSION}
>  
>  FONTDIR ?=   ${PREFIX}/share/fonts/${TYPEFACE}
>  
> -FONTTYPES ?= ttf
> +FONTTYPES ?=
>  
>  FONT_DISTDIR ?=      ${WRKSRC}
>  
> -MODFONT_do-install = ${INSTALL_DATA_DIR} ${FONTDIR}; \
> -     for t in ${FONTTYPES}; do ${INSTALL_DATA} 
> ${FONT_DISTDIR}/${FONT_DISTSUBDIR}/*.$$t ${FONTDIR}; done
> +MODFONT_do-install = ${INSTALL_DATA_DIR} ${FONTDIR};
> +
> +.if empty(FONTTYPES)
> +MODFONT_do-install += for t in otf ttf; do ${INSTALL_DATA} 
> ${FONT_DISTDIR}/${FONT_DISTSUBDIR}/*.$$t ${FONTDIR} && break; done
> +.else
> +MODFONT_do-install += for t in ${FONTTYPES}; do ${INSTALL_DATA} 
> ${FONT_DISTDIR}/${FONT_DISTSUBDIR}/*.$$t ${FONTDIR}; done
> +.endif
>  
>  .  if !target(do-install)
>  do-install:
> Index: fonts/jaldi/Makefile
> ===================================================================
> RCS file: /cvs/ports/fonts/jaldi/Makefile,v
> retrieving revision 1.2
> diff -u -p -r1.2 Makefile
> --- fonts/jaldi/Makefile      23 Jan 2023 09:47:12 -0000      1.2
> +++ fonts/jaldi/Makefile      9 May 2023 12:42:37 -0000
> @@ -2,6 +2,7 @@ COMMENT =     libre Devanagari typeface fami
>  
>  TYPEFACE =   jaldi
>  V =          1.007
> +REVISION =   0
>  
>  DISTFILES =  ${V}.zip
>  MASTER_SITES =       https://github.com/Omnibus-Type/Jaldi/archive/refs/tags/
> Index: fonts/jaldi/pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/fonts/jaldi/pkg/PLIST,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 PLIST
> --- fonts/jaldi/pkg/PLIST     23 Jun 2022 12:50:04 -0000      1.1.1.1
> +++ fonts/jaldi/pkg/PLIST     9 May 2023 12:42:37 -0000
> @@ -1,4 +1,4 @@
>  share/fonts/
>  @fontdir share/fonts/jaldi/
> -share/fonts/jaldi/Jaldi-Bold.ttf
> -share/fonts/jaldi/Jaldi-Regular.ttf
> +share/fonts/jaldi/Jaldi-Bold.otf
> +share/fonts/jaldi/Jaldi-Regular.otf
> 

-- 
Matthieu Herrb

Reply via email to