Codebase list libass / 33edd419-15bb-4fb0-844e-951788f161e4/main
New upstream snapshot. Debian Janitor 2 years ago
35 changed file(s) with 2321 addition(s) and 1018 deletion(s). Raw diff Collapse all Expand all
0 # Makefile.in generated by automake 1.16.1 from Makefile.am.
0 # Makefile.in generated by automake 1.16.4 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2021 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
167167 $(am__extra_recursive_targets)
168168 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
169169 cscope distdir distdir-am dist dist-all distcheck
170 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
171 $(LISP)config.h.in
170 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
171 config.h.in
172172 # Read a list of newline-separated strings from the standard input,
173173 # and print each of them once, without duplicates. Input order is
174174 # *not* preserved.
185185 unique=`for i in $$list; do \
186186 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
187187 done | $(am__uniquify_input)`
188 ETAGS = etags
189 CTAGS = ctags
190 CSCOPE = cscope
191188 DIST_SUBDIRS = libass test compare profile
192189 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
193 $(srcdir)/libass.pc.in COPYING compile config.guess config.sub \
194 install-sh ltmain.sh missing
190 $(srcdir)/libass.pc.in COPYING README.md compile config.guess \
191 config.sub install-sh ltmain.sh missing
195192 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
196193 distdir = $(PACKAGE)-$(VERSION)
197194 top_distdir = $(distdir)
230227 DIST_ARCHIVES = $(distdir).tar.gz
231228 GZIP_ENV = --best
232229 DIST_TARGETS = dist-gzip
230 # Exists only to be overridden by the user if desired.
231 AM_DISTCHECK_DVI_TARGET = dvi
233232 distuninstallcheck_listfiles = find . -type f -print
234233 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
235234 | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
249248 CFLAGS = @CFLAGS@
250249 CPP = @CPP@
251250 CPPFLAGS = @CPPFLAGS@
251 CSCOPE = @CSCOPE@
252 CTAGS = @CTAGS@
252253 CYGPATH_W = @CYGPATH_W@
253254 DEFS = @DEFS@
254255 DEPDIR = @DEPDIR@
259260 ECHO_N = @ECHO_N@
260261 ECHO_T = @ECHO_T@
261262 EGREP = @EGREP@
263 ETAGS = @ETAGS@
262264 EXEEXT = @EXEEXT@
263265 FGREP = @FGREP@
264266 FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
360362 prefix = @prefix@
361363 program_transform_name = @program_transform_name@
362364 psdir = @psdir@
365 runstatedir = @runstatedir@
363366 sbindir = @sbindir@
364367 sharedstatedir = @sharedstatedir@
365368 srcdir = @srcdir@
566569 distclean-tags:
567570 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
568571 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
569
570572 distdir: $(BUILT_SOURCES)
571573 $(MAKE) $(AM_MAKEFLAGS) distdir-am
572574
650652 tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
651653 $(am__post_remove_distdir)
652654
655 dist-zstd: distdir
656 tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
657 $(am__post_remove_distdir)
658
653659 dist-tarZ: distdir
654660 @echo WARNING: "Support for distribution archives compressed with" \
655661 "legacy program 'compress' is deprecated." >&2
692698 eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
693699 *.zip*) \
694700 unzip $(distdir).zip ;;\
701 *.tar.zst*) \
702 zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
695703 esac
696704 chmod -R a-w $(distdir)
697705 chmod u+w $(distdir)
707715 $(DISTCHECK_CONFIGURE_FLAGS) \
708716 --srcdir=../.. --prefix="$$dc_install_base" \
709717 && $(MAKE) $(AM_MAKEFLAGS) \
710 && $(MAKE) $(AM_MAKEFLAGS) dvi \
718 && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
711719 && $(MAKE) $(AM_MAKEFLAGS) check \
712720 && $(MAKE) $(AM_MAKEFLAGS) install \
713721 && $(MAKE) $(AM_MAKEFLAGS) installcheck \
872880 am--refresh check check-am clean clean-cscope clean-generic \
873881 clean-libtool cscope cscopelist-am ctags ctags-am dist \
874882 dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
875 dist-xz dist-zip distcheck distclean distclean-generic \
876 distclean-hdr distclean-libtool distclean-tags distcleancheck \
877 distdir distuninstallcheck dvi dvi-am html html-am info \
878 info-am install install-am install-data install-data-am \
879 install-dvi install-dvi-am install-exec install-exec-am \
880 install-html install-html-am install-info install-info-am \
881 install-man install-pdf install-pdf-am install-pkgconfigDATA \
882 install-ps install-ps-am install-strip installcheck \
883 installcheck-am installdirs installdirs-am maintainer-clean \
884 maintainer-clean-generic mostlyclean mostlyclean-generic \
885 mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
886 uninstall-am uninstall-pkgconfigDATA
883 dist-xz dist-zip dist-zstd distcheck distclean \
884 distclean-generic distclean-hdr distclean-libtool \
885 distclean-tags distcleancheck distdir distuninstallcheck dvi \
886 dvi-am html html-am info info-am install install-am \
887 install-data install-data-am install-dvi install-dvi-am \
888 install-exec install-exec-am install-html install-html-am \
889 install-info install-info-am install-man install-pdf \
890 install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
891 install-strip installcheck installcheck-am installdirs \
892 installdirs-am maintainer-clean maintainer-clean-generic \
893 mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
894 ps ps-am tags tags-am uninstall uninstall-am \
895 uninstall-pkgconfigDATA
887896
888897 .PRECIOUS: Makefile
889898
0 [![Build status](https://github.com/libass/libass/actions/workflows/ghci.yml/badge.svg?branch=master&event=push)](https://github.com/libass/libass/actions/workflows/ghci.yml?query=branch%3Amaster+event%3Apush)
1
2 [![Coverity scan build status](https://scan.coverity.com/projects/3531/badge.svg)](https://scan.coverity.com/projects/3531)
3
4 libass
5 ======
6 libass is a portable subtitle renderer for the ASS/SSA (Advanced Substation Alpha/Substation Alpha) subtitle format. It is mostly compatible with VSFilter.
7
8 Get it
9 ======
10 See [GitHub releases](https://github.com/libass/libass/releases) for the latest release 0.15.1 (released 2021-05-01). This is a bug fix release. See the [changelog](https://github.com/libass/libass/blob/master/Changelog) for a detailed list of changes.
11
12 Source code is available from our [GitHub repository](https://github.com/libass/libass).
13
14 Contact
15 =======
16 Please use the [issue tracker](https://github.com/libass/libass/issues?state=open) to report bugs or feature requests. We have an IRC channel, too. Talk to us on [irc.libera.chat/#libass](irc://irc.libera.chat/libass).
17
18 Related Links
19 =============
20 The following projects/companies use libass:
21
22 - [MPlayer](http://www.mplayerhq.hu/)
23 - [mplayer2](http://www.mplayer2.org/)
24 - [mpv](http://mpv.io/)
25 - [VLC](http://www.videolan.org/)
26 - [GStreamer](http://gstreamer.freedesktop.org/) (assrender plugin)
27 - [FFmpeg](http://ffmpeg.org/)
28 - [Libav](http://libav.org/) (unmaintained)
29 - [Aegisub](http://www.aegisub.org/)
30 - [Kodi (XBMC)](http://kodi.tv/)
31 - [avidemux](http://fixounet.free.fr/avidemux/)
32 - [PunkGraphicsStream (BD subtitle encoder)](http://code.google.com/p/punkgraphicstream/)
33 - [HandBrake](http://handbrake.fr/)
34 - [MX Player](https://play.google.com/store/apps/details?id=com.mxtech.videoplayer.ad)
35 - [QMPlay2](http://zaps166.sourceforge.net/?app=QMPlay2)
36 - [SubtitlesOctopus](https://github.com/libass/JavascriptSubtitlesOctopus) (JavaScript ASS via wasm libass)
37 - [Crunchyroll](http://www.crunchyroll.com/) uses SubtitlesOctopus
38 - [AssRender for Avisynth(+)](http://avisynth.nl/index.php/AssRender)
39
40 Information about the ASS format:
41 =================================
42 - [ASS specification (incomplete)](http://moodub.free.fr/video/ass-specs.doc)
43 - [ASS override tags (Aegisub manual)](http://docs.aegisub.org/latest/ASS_Tags/)
44 - [VSFilter source code (Guliverkli2)](http://sourceforge.net/p/guliverkli2/code/HEAD/tree/src/subtitles/)
45
46 Other ASS/SSA implementations:
47 ==============================
48 - VSFilter:
49 - [xy-VSFilter/XySubFilter](https://github.com/Cyberbeing/xy-VSFilter/)
50 - [pfmod](https://github.com/pinterf/xy-VSFilter/)
51 - VSFilter in [MPC-HC](https://github.com/clsid2/mpc-hc/tree/develop/src/filters/transform/VSFilter/)
52 - [VSFilterMod](https://code.google.com/archive/p/vsfiltermod/) (with custom format extensions)
53 - [sorayuki fork](https://github.com/sorayuki/VSFilterMod/) with some bugfixes
54 - [Threaded VSFilter](https://code.google.com/p/threaded-vsfilter/) (defunct)
55 - VSFilter in [Guliverkli2](http://sourceforge.net/projects/guliverkli2/) (defunct, subsumed by all of the above)
56 - VSFilter in [guliverkli](http://sourceforge.net/projects/guliverkli/) (defunct, forked as Guliverkli2)
57 - [ffdshow](http://ffdshow-tryout.sourceforge.net/) (defunct)
58 - [Perian](https://github.com/MaddTheSane/perian) (defunct)
59 - [asa](http://git.spaceboyz.net/asa.git) (defunct)
60 - [libjass](https://github.com/Arnavion/libjass) (defunct)
61 - [ASS.js](https://github.com/weizhenye/ASS)
0 # generated automatically by aclocal 1.16.1 -*- Autoconf -*-
1
2 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
0 # generated automatically by aclocal 1.16.4 -*- Autoconf -*-
1
2 # Copyright (C) 1996-2021 Free Software Foundation, Inc.
33
44 # This file is free software; the Free Software Foundation
55 # gives unlimited permission to copy and/or distribute it,
295295 AS_VAR_IF([$1], [""], [$5], [$4])dnl
296296 ])dnl PKG_CHECK_VAR
297297
298 # Copyright (C) 2002-2018 Free Software Foundation, Inc.
298 # Copyright (C) 2002-2021 Free Software Foundation, Inc.
299299 #
300300 # This file is free software; the Free Software Foundation
301301 # gives unlimited permission to copy and/or distribute it,
310310 [am__api_version='1.16'
311311 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
312312 dnl require some minimum version. Point them to the right macro.
313 m4_if([$1], [1.16.1], [],
313 m4_if([$1], [1.16.4], [],
314314 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
315315 ])
316316
326326 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
327327 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
328328 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
329 [AM_AUTOMAKE_VERSION([1.16.1])dnl
329 [AM_AUTOMAKE_VERSION([1.16.4])dnl
330330 m4_ifndef([AC_AUTOCONF_VERSION],
331331 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
332332 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
333333
334334 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
335335
336 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
336 # Copyright (C) 2001-2021 Free Software Foundation, Inc.
337337 #
338338 # This file is free software; the Free Software Foundation
339339 # gives unlimited permission to copy and/or distribute it,
385385
386386 # AM_COND_IF -*- Autoconf -*-
387387
388 # Copyright (C) 2008-2018 Free Software Foundation, Inc.
388 # Copyright (C) 2008-2021 Free Software Foundation, Inc.
389389 #
390390 # This file is free software; the Free Software Foundation
391391 # gives unlimited permission to copy and/or distribute it,
422422
423423 # AM_CONDITIONAL -*- Autoconf -*-
424424
425 # Copyright (C) 1997-2018 Free Software Foundation, Inc.
425 # Copyright (C) 1997-2021 Free Software Foundation, Inc.
426426 #
427427 # This file is free software; the Free Software Foundation
428428 # gives unlimited permission to copy and/or distribute it,
453453 Usually this means the macro was only invoked conditionally.]])
454454 fi])])
455455
456 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
456 # Copyright (C) 1999-2021 Free Software Foundation, Inc.
457457 #
458458 # This file is free software; the Free Software Foundation
459459 # gives unlimited permission to copy and/or distribute it,
644644
645645 # Generate code to set up dependency tracking. -*- Autoconf -*-
646646
647 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
647 # Copyright (C) 1999-2021 Free Software Foundation, Inc.
648648 #
649649 # This file is free software; the Free Software Foundation
650650 # gives unlimited permission to copy and/or distribute it,
683683 done
684684 if test $am_rc -ne 0; then
685685 AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
686 for automatic dependency tracking. Try re-running configure with the
686 for automatic dependency tracking. If GNU make was not used, consider
687 re-running the configure script with MAKE="gmake" (or whatever is
688 necessary). You can also try re-running configure with the
687689 '--disable-dependency-tracking' option to at least be able to build
688690 the package (albeit without support for automatic dependency tracking).])
689691 fi
710712
711713 # Do all the work for Automake. -*- Autoconf -*-
712714
713 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
715 # Copyright (C) 1996-2021 Free Software Foundation, Inc.
714716 #
715717 # This file is free software; the Free Software Foundation
716718 # gives unlimited permission to copy and/or distribute it,
774776 [_AM_SET_OPTIONS([$1])dnl
775777 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
776778 m4_if(
777 m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
779 m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
778780 [ok:ok],,
779781 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
780782 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
826828 [m4_define([AC_PROG_OBJCXX],
827829 m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
828830 ])
831 # Variables for tags utilities; see am/tags.am
832 if test -z "$CTAGS"; then
833 CTAGS=ctags
834 fi
835 AC_SUBST([CTAGS])
836 if test -z "$ETAGS"; then
837 ETAGS=etags
838 fi
839 AC_SUBST([ETAGS])
840 if test -z "$CSCOPE"; then
841 CSCOPE=cscope
842 fi
843 AC_SUBST([CSCOPE])
844
829845 AC_REQUIRE([AM_SILENT_RULES])dnl
830846 dnl The testsuite driver may need to know about EXEEXT, so add the
831847 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
907923 done
908924 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
909925
910 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
926 # Copyright (C) 2001-2021 Free Software Foundation, Inc.
911927 #
912928 # This file is free software; the Free Software Foundation
913929 # gives unlimited permission to copy and/or distribute it,
928944 fi
929945 AC_SUBST([install_sh])])
930946
931 # Copyright (C) 2003-2018 Free Software Foundation, Inc.
947 # Copyright (C) 2003-2021 Free Software Foundation, Inc.
932948 #
933949 # This file is free software; the Free Software Foundation
934950 # gives unlimited permission to copy and/or distribute it,
949965
950966 # Check to see how 'make' treats includes. -*- Autoconf -*-
951967
952 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
968 # Copyright (C) 2001-2021 Free Software Foundation, Inc.
953969 #
954970 # This file is free software; the Free Software Foundation
955971 # gives unlimited permission to copy and/or distribute it,
9921008
9931009 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
9941010
995 # Copyright (C) 1997-2018 Free Software Foundation, Inc.
1011 # Copyright (C) 1997-2021 Free Software Foundation, Inc.
9961012 #
9971013 # This file is free software; the Free Software Foundation
9981014 # gives unlimited permission to copy and/or distribute it,
10131029 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
10141030 AC_REQUIRE_AUX_FILE([missing])dnl
10151031 if test x"${MISSING+set}" != xset; then
1016 case $am_aux_dir in
1017 *\ * | *\ *)
1018 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1019 *)
1020 MISSING="\${SHELL} $am_aux_dir/missing" ;;
1021 esac
1032 MISSING="\${SHELL} '$am_aux_dir/missing'"
10221033 fi
10231034 # Use eval to expand $SHELL
10241035 if eval "$MISSING --is-lightweight"; then
10311042
10321043 # Helper functions for option handling. -*- Autoconf -*-
10331044
1034 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
1045 # Copyright (C) 2001-2021 Free Software Foundation, Inc.
10351046 #
10361047 # This file is free software; the Free Software Foundation
10371048 # gives unlimited permission to copy and/or distribute it,
10601071 AC_DEFUN([_AM_IF_OPTION],
10611072 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
10621073
1063 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
1074 # Copyright (C) 1999-2021 Free Software Foundation, Inc.
10641075 #
10651076 # This file is free software; the Free Software Foundation
10661077 # gives unlimited permission to copy and/or distribute it,
11071118 # For backward compatibility.
11081119 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
11091120
1110 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
1121 # Copyright (C) 2001-2021 Free Software Foundation, Inc.
11111122 #
11121123 # This file is free software; the Free Software Foundation
11131124 # gives unlimited permission to copy and/or distribute it,
11261137
11271138 # Check to make sure that the build environment is sane. -*- Autoconf -*-
11281139
1129 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
1140 # Copyright (C) 1996-2021 Free Software Foundation, Inc.
11301141 #
11311142 # This file is free software; the Free Software Foundation
11321143 # gives unlimited permission to copy and/or distribute it,
12071218 rm -f conftest.file
12081219 ])
12091220
1210 # Copyright (C) 2009-2018 Free Software Foundation, Inc.
1221 # Copyright (C) 2009-2021 Free Software Foundation, Inc.
12111222 #
12121223 # This file is free software; the Free Software Foundation
12131224 # gives unlimited permission to copy and/or distribute it,
12671278 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
12681279 ])
12691280
1270 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
1281 # Copyright (C) 2001-2021 Free Software Foundation, Inc.
12711282 #
12721283 # This file is free software; the Free Software Foundation
12731284 # gives unlimited permission to copy and/or distribute it,
12951306 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
12961307 AC_SUBST([INSTALL_STRIP_PROGRAM])])
12971308
1298 # Copyright (C) 2006-2018 Free Software Foundation, Inc.
1309 # Copyright (C) 2006-2021 Free Software Foundation, Inc.
12991310 #
13001311 # This file is free software; the Free Software Foundation
13011312 # gives unlimited permission to copy and/or distribute it,
13141325
13151326 # Check how to create a tarball. -*- Autoconf -*-
13161327
1317 # Copyright (C) 2004-2018 Free Software Foundation, Inc.
1328 # Copyright (C) 2004-2021 Free Software Foundation, Inc.
13181329 #
13191330 # This file is free software; the Free Software Foundation
13201331 # gives unlimited permission to copy and/or distribute it,
0 # Makefile.in generated by automake 1.16.1 from Makefile.am.
0 # Makefile.in generated by automake 1.16.4 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2021 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
172172 unique=`for i in $$list; do \
173173 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
174174 done | $(am__uniquify_input)`
175 ETAGS = etags
176 CTAGS = ctags
177 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
175 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
176 README.md
178177 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
179178 ACLOCAL = @ACLOCAL@
180179 AMTAR = @AMTAR@
191190 CFLAGS = @CFLAGS@
192191 CPP = @CPP@
193192 CPPFLAGS = @CPPFLAGS@
193 CSCOPE = @CSCOPE@
194 CTAGS = @CTAGS@
194195 CYGPATH_W = @CYGPATH_W@
195196 DEFS = @DEFS@
196197 DEPDIR = @DEPDIR@
201202 ECHO_N = @ECHO_N@
202203 ECHO_T = @ECHO_T@
203204 EGREP = @EGREP@
205 ETAGS = @ETAGS@
204206 EXEEXT = @EXEEXT@
205207 FGREP = @FGREP@
206208 FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
302304 prefix = @prefix@
303305 program_transform_name = @program_transform_name@
304306 psdir = @psdir@
307 runstatedir = @runstatedir@
305308 sbindir = @sbindir@
306309 sharedstatedir = @sharedstatedir@
307310 srcdir = @srcdir@
483486
484487 distclean-tags:
485488 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
486
487489 distdir: $(BUILT_SOURCES)
488490 $(MAKE) $(AM_MAKEFLAGS) distdir-am
489491
0 Regression Testing
1 ==================
2
3 To build a test utility configure libass with the `--enable-compare` flag.
4 The utility works with `png` image files so there is external dependency of libpng.
5
6 Test program command line:
7 `compare ([-i] <input-dir>)+ [-o <output-dir>] [-s <scale:1-8>] [-p <pass-level:0-3>]`
8
9 * `<input-dir>` is a test input directory, can be several of them;
10 * `<output-dir>` if present sets directory to store the rendering results;
11 * `<scale>` sets an oversampling factor (positive integer up to 8, default 1);
12 * `<pass-level>` corresponds to the level of image differences required to pass test:
13 - 0: only `SAME` level accepted, bitwise comparison mode;
14 - 1: `GOOD` level or less required;
15 - 2: `BAD` level or less required, default mode;
16 - 3: `FAIL` level or less required, i. e. any difference accepted, error checking mode.
17
18 An input directory consists of font files (`*.ttf`, `*.otf` and `*.pfb`), subtitle files (`*.ass`), and image files (`*.png`).
19 All the fonts required for rendering should be present in the input directories as
20 libass is configured to not use anything external outside of it (`ASS_FONTPROVIDER_NONE`).
21 After loading all the fonts in the directories, the test program scans for subtitle files (`<sub_name>.ass`)
22 and their corresponding image files in the form of `<sub_name>-NNNN.png`,
23 where `NNNN` is an arbitrary number of decimal digits.
24 The subtitle file then would be rendered at the time of `NNNN` milliseconds and compared with the loaded image file.
25 For example, an input directory can have the following structure:
26
27 ```
28 test/
29 font1.ttf
30 font2.otf
31 sub1.ass
32 sub1-0500.png
33 sub1-1500.png
34 sub1-2500.png
35 sub2.ass
36 sub2-153000.png
37 ```
38
39 More precisely, the test program (`compare`) would scan all input directories and do the following:
40 1) load all the fonts found (`*.ttf`, `*.otf`, `*.pfb`);
41 2) search for subtitle files (`*.ass`);
42 3) for every file found (`<sub_name>.ass`) scan for the files with names of `<sub_name>-NNNN.png`;
43 4) interpret `NNNN` as a time in milliseconds and render the subtitle file at that time with a transparent background;
44 5) fuzzy compare the rendering result with the corresponding png file;
45 6) save the rendering result in the output directory if requested.
46
47 Target images should be transparent RGBA png files with 8 or 16 bits per channel.
48 A subtitle rendering resolution is determined by the extents of the target image files multiplied by an optional scale factor (`-s` switch).
49 In the case of nontrivial scale factor, the result would be downsampled using 16-bit precision before comparison.
50 Downsampling is done assuming a linear color space which is physically incorrect but commonly used in computer rendering.
51
52 It's possible to save rendering results by using `-o` switch.
53 Saved files would have the same names as the target image files.
54 That functionality can be used for an initial generation of target images
55 by supplying arbitrary source images with correct names and extents.
56
57 Test program output can look like the following:
58 ```
59 Loading font 'font1.ttf'.
60 Loading font 'font2.otf'.
61 Processing 'sub1.ass':
62 Time 0:00:00.500 - 2.464 BAD
63 Time 0:00:01.500 - 1.412 OK
64 Time 0:00:02.500 - 4.919 FAIL
65 Processing 'sub2.ass':
66 Time 0:02:33.000 - 0.728 OK
67 Only 3 of 4 images have passed test
68 ```
69 For each target image file the program reports a maximal ratio of the per pixel comparison difference to the baseline error scale.
70 The baseline error scale tries to take account of neighboring pixels to estimate visibility of a difference in that specific pixel location.
71 Zero difference is marked as `SAME` (level 0), nonzero value in the range of [0–2.0] is marked as `GOOD` (level 1),
72 in the range of [2.0–4.0] as `BAD` (level 2) and more than 4.0 as `FAIL` (level 3).
73 Any problem during processing of a specific image is treated as a level 4 difference.
74 If all images have level of difference less or equal to pass level (`-p` switch, default 2) then the test is considered as passed
75 and program returns 0. Otherwise program returns maximal level of difference throughout all images (4 in case of error).
76
77 Note that almost any type of a rendering error can be greatly exaggerated by the specially tailored test cases.
78 Therefore test cases should be chosen to represent generic real world scenarios only.
2121 #include <sys/stat.h>
2222 #include <dirent.h>
2323 #include <string.h>
24
25 #if defined(_WIN32) && !defined(__CYGWIN__)
26 #include <direct.h>
27 #define mkdir(path, mode) _mkdir(path)
28 #endif
2429
2530
2631 #define FFMAX(a,b) ((a) > (b) ? (a) : (b))
279284 const char *dir, const char *file)
280285 {
281286 char path[4096];
282 snprintf(path, sizeof(path), "%s/%s.ass", dir, file);
287 snprintf(path, sizeof(path), "%s/%s", dir, file);
283288 ASS_Track *track = ass_read_file(lib, path, NULL);
284289 if (!track) {
285 printf("Cannot load subtitle file '%s.ass'!\n", file);
290 printf("Cannot load subtitle file '%s'!\n", file);
286291 return NULL;
287292 }
288 printf("Processing '%s.ass':\n", file);
293 printf("Processing '%s':\n", file);
289294 return track;
290295 }
291296
295300 return false;
296301 }
297302
298 static bool process_image(ASS_Renderer *renderer, ASS_Track *track,
299 const char *input, const char *output,
300 const char *file, int64_t time, int scale)
303 typedef enum {
304 R_SAME, R_GOOD, R_BAD, R_FAIL, R_ERROR
305 } Result;
306
307 static const char *result_text[R_ERROR] = {
308 "SAME", "GOOD", "BAD", "FAIL"
309 };
310
311 Result classify_result(double error)
312 {
313 if (error == 0)
314 return R_SAME;
315 else if (error < 2)
316 return R_GOOD;
317 else if (error < 4)
318 return R_BAD;
319 else
320 return R_FAIL;
321 }
322
323 static Result process_image(ASS_Renderer *renderer, ASS_Track *track,
324 const char *input, const char *output,
325 const char *file, int64_t time, int scale)
301326 {
302327 uint64_t tm = time;
303328 unsigned msec = tm % 1000; tm /= 1000;
311336 Image16 target;
312337 if (!read_png(path, &target)) {
313338 printf("PNG reading failed!\n");
314 return false;
339 return R_ERROR;
315340 }
316341
317342 uint16_t *grad = malloc(2 * target.width * target.height);
318343 if (!grad) {
319344 free(target.buffer);
320 return out_of_memory();
345 out_of_memory();
346 return R_ERROR;
321347 }
322348 calc_grad(&target, grad);
323349
334360 int res = compare(&target, grad, img, out_file, &max_err, scale);
335361 free(target.buffer);
336362 free(grad);
337 if (!res)
338 return out_of_memory();
339 bool flag = max_err < 4;
340 printf("%.3f %s\n", max_err, flag ? (max_err < 2 ? "OK" : "BAD") : "FAIL");
363 if (!res) {
364 out_of_memory();
365 return R_ERROR;
366 }
367 Result flag = classify_result(max_err);
368 printf("%.3f %s\n", max_err, result_text[flag]);
341369 if (res < 0)
342370 printf("Cannot write PNG to file '%s'!\n", path);
343371 return flag;
346374
347375 typedef struct {
348376 char *name;
377 size_t prefix;
378 const char *dir;
349379 int64_t time;
350380 } Item;
351381
354384 Item *items;
355385 } ItemList;
356386
357 static bool init_items(ItemList *list)
358 {
359 int n = 256;
360 list->n_items = list->max_items = 0;
361 list->items = malloc(n * sizeof(Item));
362 if (!list->items)
363 return out_of_memory();
364 list->max_items = n;
365 return true;
366 }
367
368387 static bool add_item(ItemList *list)
369388 {
370389 if (list->n_items < list->max_items)
371390 return true;
372391
373 int n = 2 * list->max_items;
392 size_t n = list->max_items ? 2 * list->max_items : 256;
374393 Item *next = realloc(list->items, n * sizeof(Item));
375394 if (!next)
376395 return out_of_memory();
389408 static int item_compare(const void *ptr1, const void *ptr2)
390409 {
391410 const Item *e1 = ptr1, *e2 = ptr2;
392 int cmp = strcmp(e1->name, e2->name);
411
412 int cmp_len = 0;
413 size_t len = e1->prefix;
414 if (len > e2->prefix) {
415 cmp_len = +1;
416 len = e2->prefix;
417 } else if (len < e2->prefix) {
418 cmp_len = -1;
419 }
420 int cmp = memcmp(e1->name, e2->name, len);
393421 if (cmp)
394422 return cmp;
423 if (cmp_len)
424 return cmp_len;
395425 if (e1->time > e2->time)
396426 return +1;
397427 if (e1->time < e2->time)
400430 }
401431
402432
403 static bool add_sub_item(ItemList *list, const char *file, int len)
433 static bool add_sub_item(ItemList *list, const char *dir, const char *file, size_t len)
404434 {
405435 if (!add_item(list))
406436 return false;
407437
408438 Item *item = &list->items[list->n_items];
409 item->name = strndup(file, len);
439 item->name = strdup(file);
410440 if (!item->name)
411441 return out_of_memory();
442 item->prefix = len;
443 item->dir = dir;
412444 item->time = -1;
413445 list->n_items++;
414446 return true;
415447 }
416448
417 static bool add_img_item(ItemList *list, const char *file, int len)
449 static bool add_img_item(ItemList *list, const char *dir, const char *file, size_t len)
418450 {
419451 // Parse image name:
420452 // <subtitle_name>-<time_in_msec>.png
421453
422 int pos = len, first = len;
454 size_t pos = len, first = len;
423455 while (true) {
424456 if (!pos--)
425457 return true;
440472 item->name = strdup(file);
441473 if (!item->name)
442474 return out_of_memory();
443 item->name[pos] = '\0';
475 item->prefix = pos;
476 item->dir = dir;
444477 item->time = 0;
445 for (int i = first; i < len; i++)
478 for (size_t i = first; i < len; i++)
446479 item->time = 10 * item->time + (file[i] - '0');
447480 list->n_items++;
448481 return true;
449482 }
450483
451
452 static int print_usage(const char *program)
453 {
484 static bool process_input(ItemList *list, const char *path, ASS_Library *lib)
485 {
486 DIR *dir = opendir(path);
487 if (!dir) {
488 printf("Cannot open input directory '%s'!\n", path);
489 return false;
490 }
491 struct dirent *file;
492 while ((file = readdir(dir))) {
493 const char *name = file->d_name;
494 if (name[0] == '.')
495 continue;
496 const char *ext = strrchr(name + 1, '.');
497 if (!ext)
498 continue;
499
500 char ext_lc[5];
501 size_t pos = 0;
502 while (pos < sizeof(ext_lc) - 1) {
503 char c = ext[pos + 1];
504 if (!c)
505 break;
506 if (c >= 'A' && c <= 'Z')
507 c += 'a' - 'A';
508 ext_lc[pos] = c;
509 pos++;
510 }
511 ext_lc[pos] = '\0';
512
513 if (!strcmp(ext_lc, "png")) {
514 if (add_img_item(list, path, name, ext - name))
515 continue;
516 } else if (!strcmp(ext_lc, "ass")) {
517 if (add_sub_item(list, path, name, ext - name))
518 continue;
519 } else if (!strcmp(ext_lc, "ttf") ||
520 !strcmp(ext_lc, "otf") ||
521 !strcmp(ext_lc, "pfb")) {
522 if (load_font(lib, path, name))
523 continue;
524 printf("Cannot load font '%s'!\n", name);
525 } else {
526 continue;
527 }
528 closedir(dir);
529 return false;
530 }
531 closedir(dir);
532 return true;
533 }
534
535
536 enum {
537 OUTPUT, SCALE, LEVEL, INPUT
538 };
539
540 static int *parse_cmdline(int argc, char *argv[])
541 {
542 int *pos = calloc(INPUT + argc, sizeof(int));
543 if (!pos) {
544 out_of_memory();
545 return NULL;
546 }
547 int input = INPUT;
548 for (int i = 1; i < argc; i++) {
549 if (argv[i][0] != '-') {
550 pos[input++] = i;
551 continue;
552 }
553 int index;
554 switch (argv[i][1]) {
555 case 'i': index = input++; break;
556 case 'o': index = OUTPUT; break;
557 case 's': index = SCALE; break;
558 case 'p': index = LEVEL; break;
559 default: goto fail;
560 }
561 if (argv[i][2] || ++i >= argc || pos[index])
562 goto fail;
563 pos[index] = i;
564 }
565 if (pos[INPUT])
566 return pos;
567
568 fail:
569 free(pos);
454570 const char *fmt =
455 "Usage: %s [-i] <input-dir> [-o <output-dir>] [-s <scale:1-8>]\n";
456 printf(fmt, program);
457 return 1;
571 "Usage: %s ([-i] <input-dir>)+ [-o <output-dir>] [-s <scale:1-8>] [-p <pass-level:0-3>]\n";
572 printf(fmt, argv[0]);
573 return NULL;
458574 }
459575
460576 void msg_callback(int level, const char *fmt, va_list va, void *data)
461577 {
462578 if (level > 3)
463579 return;
464 printf("libass: ");
465 vprintf(fmt, va);
466 printf("\n");
580 fprintf(stderr, "libass: ");
581 vfprintf(stderr, fmt, va);
582 fprintf(stderr, "\n");
467583 }
468584
469585 int main(int argc, char *argv[])
470586 {
471 enum {
472 INPUT, OUTPUT, SCALE
473 };
474 int pos[3] = {0};
475 for (int i = 1; i < argc; i++) {
476 if (argv[i][0] != '-') {
477 if (pos[INPUT])
478 return print_usage(argv[0]);
479 pos[INPUT] = i;
480 continue;
481 }
482 int index;
483 switch (argv[i][1]) {
484 case 'i': index = INPUT; break;
485 case 'o': index = OUTPUT; break;
486 case 's': index = SCALE; break;
487 default: return print_usage(argv[0]);
488 }
489 if (argv[i][2] || ++i >= argc || pos[index])
490 return print_usage(argv[0]);
491 pos[index] = i;
492 }
493 if (!pos[INPUT])
494 return print_usage(argv[0]);
587 int *pos = parse_cmdline(argc, argv);
588 if (!pos)
589 return R_ERROR;
590
591 ASS_Library *lib = NULL;
592 ItemList list = {0};
593 int result = R_ERROR;
495594
496595 int scale = 1;
497596 if (pos[SCALE]) {
498597 const char *arg = argv[pos[SCALE]];
499598 if (arg[0] < '1' || arg[0] > '8' || arg[1]) {
500599 printf("Invalid scale value, should be 1-8!\n");
501 return 1;
600 goto end;
502601 }
503602 scale = arg[0] - '0';
504603 }
505604
506 const char *input = argv[pos[INPUT]];
507 DIR *dir = opendir(input);
508 if (!dir) {
509 printf("Cannot open input directory '%s'!\n", input);
510 return 1;
605 int level = R_BAD;
606 if (pos[LEVEL]) {
607 const char *arg = argv[pos[LEVEL]];
608 if (arg[0] < '0' || arg[0] > '3' || arg[1]) {
609 printf("Invalid pass level value, should be 0-3!\n");
610 goto end;
611 }
612 level = arg[0] - '0';
511613 }
512614
513615 const char *output = NULL;
517619 if (stat(output, &st)) {
518620 if (mkdir(output, 0755)) {
519621 printf("Cannot create output directory '%s'!\n", output);
520 closedir(dir);
521 return 1;
622 goto end;
522623 }
523624 } else if (!(st.st_mode & S_IFDIR)) {
524625 printf("Invalid output directory '%s'!\n", output);
525 closedir(dir);
526 return 1;
527 }
528 }
529
530 ASS_Library *lib = ass_library_init();
626 goto end;
627 }
628 }
629
630 lib = ass_library_init();
531631 if (!lib) {
532632 printf("ass_library_init failed!\n");
533 closedir(dir);
534 return 1;
633 goto end;
535634 }
536635 ass_set_message_cb(lib, msg_callback, NULL);
537636 ass_set_extract_fonts(lib, true);
538637
539 ItemList list;
540 if (!init_items(&list)) {
541 ass_library_done(lib);
542 closedir(dir);
543 return 1;
544 }
545
546 while (true) {
547 struct dirent *file = readdir(dir);
548 if (!file)
549 break;
550 const char *name = file->d_name;
551 if (name[0] == '.')
552 continue;
553 const char *ext = strrchr(name + 1, '.');
554 if (!ext)
555 continue;
556
557 if (!strcmp(ext, ".png")) {
558 if (add_img_item(&list, name, ext - name))
559 continue;
560 } else if (!strcmp(ext, ".ass")) {
561 if (add_sub_item(&list, name, ext - name))
562 continue;
563 } else if (!strcmp(ext, ".ttf") || !strcmp(ext, ".otf") || !strcmp(ext, ".pfb")) {
564 if (load_font(lib, input, name))
565 continue;
566 printf("Cannot load font '%s'!\n", name);
567 } else {
568 continue;
569 }
570 delete_items(&list);
571 ass_library_done(lib);
572 closedir(dir);
573 return 1;
574 }
575 closedir(dir);
638 for (int *input = pos + INPUT; *input; input++) {
639 if (!process_input(&list, argv[*input], lib))
640 goto end;
641 }
576642
577643 ASS_Renderer *renderer = ass_renderer_init(lib);
578644 if (!renderer) {
579645 printf("ass_renderer_init failed!\n");
580 delete_items(&list);
581 ass_library_done(lib);
582 return 1;
646 goto end;
583647 }
584648 ass_set_fonts(renderer, NULL, NULL, ASS_FONTPROVIDER_NONE, NULL, 0);
585649
586 int prefix;
650 result = 0;
651 size_t prefix = 0;
587652 const char *prev = "";
588653 ASS_Track *track = NULL;
589654 unsigned total = 0, good = 0;
590655 qsort(list.items, list.n_items, sizeof(Item), item_compare);
591656 for (size_t i = 0; i < list.n_items; i++) {
592 if (strcmp(prev, list.items[i].name)) {
593 if (track)
657 char *name = list.items[i].name;
658 size_t len = list.items[i].prefix;
659 if (prefix != len || memcmp(prev, name, len)) {
660 if (track) {
594661 ass_free_track(track);
595 prev = list.items[i].name;
596 prefix = strlen(prev);
597 if (list.items[i].time < 0)
598 track = load_track(lib, input, prev);
599 else {
600 printf("Missing subtitle file '%s.ass'!\n", prev);
601662 track = NULL;
663 }
664 prev = name;
665 prefix = len;
666 if (list.items[i].time >= 0) {
667 printf("Missing subtitle file '%.*s.ass'!\n", (int) len, name);
602668 total++;
603 }
669 } else if (i + 1 < list.n_items && list.items[i + 1].time >= 0)
670 track = load_track(lib, list.items[i].dir, prev);
604671 continue;
605672 }
606
673 if (list.items[i].time < 0) {
674 printf("Multiple subtitle files '%.*s.ass'!\n", (int) len, name);
675 continue;
676 }
607677 total++;
608678 if (!track)
609679 continue;
610 char *name = list.items[i].name;
611 name[prefix] = '-'; // restore initial filename
612 if (process_image(renderer, track, input, output,
613 name, list.items[i].time, scale))
680 Result res = process_image(renderer, track, list.items[i].dir, output,
681 name, list.items[i].time, scale);
682 result = FFMAX(result, res);
683 if (res <= level)
614684 good++;
615685 }
616686 if (track)
617687 ass_free_track(track);
688 ass_renderer_done(renderer);
689
690 if (!total) {
691 printf("No images found!\n");
692 result = R_ERROR;
693 } else if (good < total) {
694 printf("Only %u of %u images have passed test (%s or better)\n",
695 good, total, result_text[level]);
696 } else {
697 printf("All %u images have passed test (%s or better)\n",
698 total, result_text[level]);
699 result = 0;
700 }
701
702 end:
618703 delete_items(&list);
619 ass_renderer_done(renderer);
620 ass_library_done(lib);
621
622 if (good < total) {
623 printf("Only %u of %u images have passed test\n", good, total);
624 return 1;
625 }
626 printf("All %u images have passed test\n", total);
627 return 0;
628 }
704 if (lib)
705 ass_library_done(lib);
706 free(pos);
707 return result;
708 }
22
33 scriptversion=2018-03-07.03; # UTC
44
5 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
5 # Copyright (C) 1999-2021 Free Software Foundation, Inc.
66 # Written by Tom Tromey <tromey@cygnus.com>.
77 #
88 # This program is free software; you can redistribute it and/or modify
5252 MINGW*)
5353 file_conv=mingw
5454 ;;
55 CYGWIN*)
55 CYGWIN* | MSYS*)
5656 file_conv=cygwin
5757 ;;
5858 *)
6666 mingw/*)
6767 file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
6868 ;;
69 cygwin/*)
69 cygwin/* | msys/*)
7070 file=`cygpath -m "$file" || echo "$file"`
7171 ;;
7272 wine/*)
11 # Attempt to guess a canonical system name.
22 # Copyright 1992-2018 Free Software Foundation, Inc.
33
4 timestamp='2018-03-08'
4 timestamp='2018-02-24'
55
66 # This file is free software; you can redistribute it and/or modify it
77 # under the terms of the GNU General Public License as published by
10451045 echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
10461046 exit ;;
10471047 x86_64:Linux:*:*)
1048 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
1048 if objdump -f /bin/sh | grep -q elf32-x86-64; then
1049 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
1050 else
1051 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
1052 fi
10491053 exit ;;
10501054 xtensa*:Linux:*:*)
10511055 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
14681472 exit 1
14691473
14701474 # Local variables:
1471 # eval: (add-hook 'before-save-hook 'time-stamp)
1475 # eval: (add-hook 'write-file-functions 'time-stamp)
14721476 # time-stamp-start: "timestamp='"
14731477 # time-stamp-format: "%:y-%02m-%02d"
14741478 # time-stamp-end: "'"
55 /* found CoreText framework */
66 #undef CONFIG_CORETEXT
77
8 /* found DirectWrite */
8 /* found DirectWrite and GDI (Win32) */
99 #undef CONFIG_DIRECTWRITE
1010
1111 /* found fontconfig via pkg-config */
11 # Configuration validation subroutine script.
22 # Copyright 1992-2018 Free Software Foundation, Inc.
33
4 timestamp='2018-03-08'
4 timestamp='2018-02-22'
55
66 # This file is free software; you can redistribute it and/or modify it
77 # under the terms of the GNU General Public License as published by
13751375 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
13761376 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
13771377 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1378 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \
1378 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
13791379 | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
13801380 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
13811381 | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
17931793 exit
17941794
17951795 # Local variables:
1796 # eval: (add-hook 'before-save-hook 'time-stamp)
1796 # eval: (add-hook 'write-file-functions 'time-stamp)
17971797 # time-stamp-start: "timestamp='"
17981798 # time-stamp-format: "%:y-%02m-%02d"
17991799 # time-stamp-end: "'"
725725 AM_DEFAULT_VERBOSITY
726726 AM_DEFAULT_V
727727 AM_V
728 CSCOPE
729 ETAGS
730 CTAGS
728731 am__untar
729732 am__tar
730733 AMTAR
767770 docdir
768771 oldincludedir
769772 includedir
773 runstatedir
770774 localstatedir
771775 sharedstatedir
772776 sysconfdir
871875 sysconfdir='${prefix}/etc'
872876 sharedstatedir='${prefix}/com'
873877 localstatedir='${prefix}/var'
878 runstatedir='${localstatedir}/run'
874879 includedir='${prefix}/include'
875880 oldincludedir='/usr/include'
876881 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
11231128 | -silent | --silent | --silen | --sile | --sil)
11241129 silent=yes ;;
11251130
1131 -runstatedir | --runstatedir | --runstatedi | --runstated \
1132 | --runstate | --runstat | --runsta | --runst | --runs \
1133 | --run | --ru | --r)
1134 ac_prev=runstatedir ;;
1135 -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1136 | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1137 | --run=* | --ru=* | --r=*)
1138 runstatedir=$ac_optarg ;;
1139
11261140 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
11271141 ac_prev=sbindir ;;
11281142 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
12601274 for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
12611275 datadir sysconfdir sharedstatedir localstatedir includedir \
12621276 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1263 libdir localedir mandir
1277 libdir localedir mandir runstatedir
12641278 do
12651279 eval ac_val=\$$ac_var
12661280 # Remove trailing slashes.
14131427 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
14141428 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
14151429 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1430 --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
14161431 --libdir=DIR object code libraries [EPREFIX/lib]
14171432 --includedir=DIR C header files [PREFIX/include]
14181433 --oldincludedir=DIR C header files for non-gcc [/usr/include]
14671482 [default=no]
14681483 --enable-profile enable profiling program [default=no]
14691484 --disable-fontconfig disable fontconfig support [default=enabled]
1470 --disable-directwrite disable DirectWrite support (win32 only)
1485 --disable-directwrite disable DirectWrite support (Windows only)
14711486 [default=check]
14721487 --disable-coretext disable CoreText support (OSX only) [default=check]
14731488 --disable-require-system-font-provider
24242439 am_aux_dir=`cd "$ac_aux_dir" && pwd`
24252440
24262441 if test x"${MISSING+set}" != xset; then
2427 case $am_aux_dir in
2428 *\ * | *\ *)
2429 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2430 *)
2431 MISSING="\${SHELL} $am_aux_dir/missing" ;;
2432 esac
2442 MISSING="\${SHELL} '$am_aux_dir/missing'"
24332443 fi
24342444 # Use eval to expand $SHELL
24352445 if eval "$MISSING --is-lightweight"; then
27822792
27832793
27842794
2795
2796
2797 # Variables for tags utilities; see am/tags.am
2798 if test -z "$CTAGS"; then
2799 CTAGS=ctags
2800 fi
2801
2802 if test -z "$ETAGS"; then
2803 ETAGS=etags
2804 fi
2805
2806 if test -z "$CSCOPE"; then
2807 CSCOPE=cscope
2808 fi
27852809
27862810
27872811
51785202 lt_cv_deplibs_check_method=pass_all
51795203 ;;
51805204
5181 netbsd*)
5205 netbsd* | netbsdelf*-gnu)
51825206 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
51835207 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
51845208 else
55415565 fi
55425566
55435567 : ${AR=ar}
5544 : ${AR_FLAGS=cru}
5568 : ${AR_FLAGS=cr}
55455569
55465570
55475571
60426066 test $ac_status = 0; }; then
60436067 # Now try to grab the symbols.
60446068 nlist=conftest.nm
6045 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
6046 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
6047 ac_status=$?
6048 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6049 test $ac_status = 0; } && test -s "$nlist"; then
6069 $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5
6070 if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then
60506071 # Try sorting and uniquifying the output.
60516072 if sort "$nlist" | uniq > "$nlist"T; then
60526073 mv -f "$nlist"T "$nlist"
72657286 _LT_EOF
72667287 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
72677288 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
7268 echo "$AR cru libconftest.a conftest.o" >&5
7269 $AR cru libconftest.a conftest.o 2>&5
7289 echo "$AR cr libconftest.a conftest.o" >&5
7290 $AR cr libconftest.a conftest.o 2>&5
72707291 echo "$RANLIB libconftest.a" >&5
72717292 $RANLIB libconftest.a 2>&5
72727293 cat > conftest.c << _LT_EOF
72937314 _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
72947315 darwin1.*)
72957316 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
7296 darwin*)
7297 case ${MACOSX_DEPLOYMENT_TARGET},$host in
7298 10.[012],*|,*powerpc*)
7317 darwin*) # darwin 5.x on
7318 # if running on 10.5 or later, the deployment target defaults
7319 # to the OS version, if on x86, and 10.4, the deployment
7320 # target defaults to 10.4. Don't you love it?
7321 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
7322 10.0,*86*-darwin8*|10.0,*-darwin[912]*)
7323 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
7324 10.[012][,.]*)
72997325 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
7300 *)
7326 10.*|11.*)
73017327 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
73027328 esac
73037329 ;;
83888414 ecc*)
83898415 lt_prog_compiler_wl='-Wl,'
83908416 lt_prog_compiler_pic='-KPIC'
8417 lt_prog_compiler_static='-static'
8418 ;;
8419 # flang / f18. f95 an alias for gfortran or flang on Debian
8420 flang* | f18* | f95*)
8421 lt_prog_compiler_wl='-Wl,'
8422 lt_prog_compiler_pic='-fPIC'
83918423 lt_prog_compiler_static='-static'
83928424 ;;
83938425 # icc used to be incompatible with GCC.
88668898 openbsd* | bitrig*)
88678899 with_gnu_ld=no
88688900 ;;
8901 linux* | k*bsd*-gnu | gnu*)
8902 link_all_deplibs=no
8903 ;;
88698904 esac
88708905
88718906 ld_shlibs=yes
91209155 fi
91219156 ;;
91229157
9123 netbsd*)
9158 netbsd* | netbsdelf*-gnu)
91249159 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
91259160 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
91269161 wlarc=
97909825 if test yes = "$lt_cv_irix_exported_symbol"; then
97919826 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
97929827 fi
9828 link_all_deplibs=no
97939829 else
97949830 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
97959831 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
98119847 esac
98129848 ;;
98139849
9814 netbsd*)
9850 netbsd* | netbsdelf*-gnu)
98159851 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
98169852 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
98179853 else
1092610962 dynamic_linker='GNU/Linux ld.so'
1092710963 ;;
1092810964
10965 netbsdelf*-gnu)
10966 version_type=linux
10967 need_lib_prefix=no
10968 need_version=no
10969 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
10970 soname_spec='${libname}${release}${shared_ext}$major'
10971 shlibpath_var=LD_LIBRARY_PATH
10972 shlibpath_overrides_runpath=no
10973 hardcode_into_libs=yes
10974 dynamic_linker='NetBSD ld.elf_so'
10975 ;;
10976
1092910977 netbsd*)
1093010978 version_type=sunos
1093110979 need_lib_prefix=no
1364713695 }
1364813696
1364913697 _ACEOF
13650 if ac_fn_c_try_link "$LINENO"; then :
13651
13652
13653 $as_echo "#define CONFIG_DIRECTWRITE 1" >>confdefs.h
13698 if ac_fn_c_try_compile "$LINENO"; then :
1365413699
1365513700 directwrite=true
1365613701 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1365713702 $as_echo "yes" >&6; }
13703 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Win32 desktop APIs" >&5
13704 $as_echo_n "checking for Win32 desktop APIs... " >&6; }
13705 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13706 /* end confdefs.h. */
13707
13708
13709 #include <winapifamily.h>
13710 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
13711 #error Win32 desktop APIs are available
13712 #endif
13713
13714 int
13715 main ()
13716 {
13717 ;
13718 ;
13719 return 0;
13720 }
13721
13722 _ACEOF
13723 if ac_fn_c_try_compile "$LINENO"; then :
13724
13725 # WinRT/UWP/app build: GDI and LoadLibrary are
13726 # unavailable, but DirectWrite is always present
13727 LIBS="$LIBS -ldwrite"
13728
13729 $as_echo "#define CONFIG_DIRECTWRITE 1" >>confdefs.h
13730
13731 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13732 $as_echo "no" >&6; }
13733
13734 else
13735
13736 # Win32/desktop build: GDI is always present;
13737 # DirectWrite is optional but can be loaded via LoadLibrary
13738 LIBS="$LIBS -lgdi32"
13739
13740 $as_echo "#define CONFIG_DIRECTWRITE 1" >>confdefs.h
13741
13742 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13743 $as_echo "yes" >&6; }
13744
13745 fi
13746 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1365813747
1365913748 else
1366013749
1366313752 $as_echo "no" >&6; }
1366413753
1366513754 fi
13666 rm -f core conftest.err conftest.$ac_objext \
13667 conftest$ac_exeext conftest.$ac_ext
13755 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1366813756
1366913757 fi
1367013758
1582215910 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1582315911 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1582415912 as_fn_error $? "Something went wrong bootstrapping makefile fragments
15825 for automatic dependency tracking. Try re-running configure with the
15913 for automatic dependency tracking. If GNU make was not used, consider
15914 re-running the configure script with MAKE=\"gmake\" (or whatever is
15915 necessary). You can also try re-running configure with the
1582615916 '--disable-dependency-tracking' option to at least be able to build
1582715917 the package (albeit without support for automatic dependency tracking).
1582815918 See \`config.log' for more details" "$LINENO" 5; }
1584915939 cat <<_LT_EOF >> "$cfgfile"
1585015940 #! $SHELL
1585115941 # Generated automatically by $as_me ($PACKAGE) $VERSION
15852 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1585315942 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
1585415943
1585515944 # Provide generalized library-building support services.
2727 AC_ARG_ENABLE([fontconfig], AS_HELP_STRING([--disable-fontconfig],
2828 [disable fontconfig support @<:@default=enabled@:>@]))
2929 AC_ARG_ENABLE([directwrite], AS_HELP_STRING([--disable-directwrite],
30 [disable DirectWrite support (win32 only) @<:@default=check@:>@]))
30 [disable DirectWrite support (Windows only) @<:@default=check@:>@]))
3131 AC_ARG_ENABLE([coretext], AS_HELP_STRING([--disable-coretext],
3232 [disable CoreText support (OSX only) @<:@default=check@:>@]))
3333 AC_ARG_ENABLE([require-system-font-provider], AS_HELP_STRING([--disable-require-system-font-provider],
143143 AS_IF([test "x$enable_directwrite" != xno], [
144144 # Linking to DirectWrite directly only works from Windows
145145 AC_MSG_CHECKING([for DIRECTWRITE])
146 AC_LINK_IFELSE([
146 AC_COMPILE_IFELSE([
147147 AC_LANG_PROGRAM([[#include <windows.h>]], [[;]])
148148 ], [
149 AC_DEFINE(CONFIG_DIRECTWRITE, 1, [found DirectWrite])
150149 directwrite=true
151150 AC_MSG_RESULT([yes])
151 AC_MSG_CHECKING([for Win32 desktop APIs])
152 AC_COMPILE_IFELSE([
153 AC_LANG_PROGRAM([[
154 #include <winapifamily.h>
155 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
156 #error Win32 desktop APIs are available
157 #endif
158 ]], [[;]])
159 ], [
160 # WinRT/UWP/app build: GDI and LoadLibrary are
161 # unavailable, but DirectWrite is always present
162 LIBS="$LIBS -ldwrite"
163 AC_DEFINE(CONFIG_DIRECTWRITE, 1, [found DirectWrite (WinRT/UWP)])
164 AC_MSG_RESULT([no])
165 ], [
166 # Win32/desktop build: GDI is always present;
167 # DirectWrite is optional but can be loaded via LoadLibrary
168 LIBS="$LIBS -lgdi32"
169 AC_DEFINE(CONFIG_DIRECTWRITE, 1, [found DirectWrite and GDI (Win32)])
170 AC_MSG_RESULT([yes])
171 ])
152172 ], [
153173 directwrite=false
154174 AC_MSG_RESULT([no])
0 libass (1:0.15.1+git20210815.1.a8456e6-1) UNRELEASED; urgency=low
1
2 * New upstream snapshot.
3
4 -- Debian Janitor <janitor@jelmer.uk> Mon, 16 Aug 2021 17:13:08 -0000
5
06 libass (1:0.15.1-2) unstable; urgency=medium
17
28 * Upload to unstable
22
33 scriptversion=2018-03-07.03; # UTC
44
5 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
5 # Copyright (C) 1999-2021 Free Software Foundation, Inc.
66
77 # This program is free software; you can redistribute it and/or modify
88 # it under the terms of the GNU General Public License as published by
00 #!/bin/sh
11 # install - install a program, script, or datafile
22
3 scriptversion=2018-03-11.20; # UTC
3 scriptversion=2020-11-14.01; # UTC
44
55 # This originates from X11R5 (mit/util/scripts/install.sh), which was
66 # later released in X11R6 (xc/config/util/install.sh) with the
6868 # Desired mode of installed file.
6969 mode=0755
7070
71 # Create dirs (including intermediate dirs) using mode 755.
72 # This is like GNU 'install' as of coreutils 8.32 (2020).
73 mkdir_umask=22
74
75 backupsuffix=
7176 chgrpcmd=
7277 chmodcmd=$chmodprog
7378 chowncmd=
98103 --version display version info and exit.
99104
100105 -c (ignored)
101 -C install only if different (preserve the last data modification time)
106 -C install only if different (preserve data modification time)
102107 -d create directories instead of installing files.
103108 -g GROUP $chgrpprog installed files to GROUP.
104109 -m MODE $chmodprog installed files to MODE.
105110 -o USER $chownprog installed files to USER.
111 -p pass -p to $cpprog.
106112 -s $stripprog installed files.
113 -S SUFFIX attempt to back up existing files, with suffix SUFFIX.
107114 -t DIRECTORY install into DIRECTORY.
108115 -T report an error if DSTFILE is a directory.
109116
110117 Environment variables override the default commands:
111118 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
112119 RMPROG STRIPPROG
120
121 By default, rm is invoked with -f; when overridden with RMPROG,
122 it's up to you to specify -f if you want it.
123
124 If -S is not specified, no backups are attempted.
125
126 Email bug reports to bug-automake@gnu.org.
127 Automake home page: https://www.gnu.org/software/automake/
113128 "
114129
115130 while test $# -ne 0; do
136151 -o) chowncmd="$chownprog $2"
137152 shift;;
138153
154 -p) cpprog="$cpprog -p";;
155
139156 -s) stripcmd=$stripprog;;
157
158 -S) backupsuffix="$2"
159 shift;;
140160
141161 -t)
142162 is_target_a_directory=always
254274 dstdir=$dst
255275 test -d "$dstdir"
256276 dstdir_status=$?
277 # Don't chown directories that already exist.
278 if test $dstdir_status = 0; then
279 chowncmd=""
280 fi
257281 else
258282
259283 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
300324 if test $dstdir_status != 0; then
301325 case $posix_mkdir in
302326 '')
303 # Create intermediate dirs using mode 755 as modified by the umask.
304 # This is like FreeBSD 'install' as of 1997-10-28.
305 umask=`umask`
306 case $stripcmd.$umask in
307 # Optimize common cases.
308 *[2367][2367]) mkdir_umask=$umask;;
309 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
310
311 *[0-7])
312 mkdir_umask=`expr $umask + 22 \
313 - $umask % 100 % 40 + $umask % 20 \
314 - $umask % 10 % 4 + $umask % 2
315 `;;
316 *) mkdir_umask=$umask,go-w;;
317 esac
318
319327 # With -d, create the new directory with the user-specified mode.
320328 # Otherwise, rely on $mkdir_umask.
321329 if test -n "$dir_arg"; then
325333 fi
326334
327335 posix_mkdir=false
328 case $umask in
329 *[123567][0-7][0-7])
330 # POSIX mkdir -p sets u+wx bits regardless of umask, which
331 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
332 ;;
333 *)
334 # Note that $RANDOM variable is not portable (e.g. dash); Use it
335 # here however when possible just to lower collision chance.
336 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
337
338 trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
339
340 # Because "mkdir -p" follows existing symlinks and we likely work
341 # directly in world-writeable /tmp, make sure that the '$tmpdir'
342 # directory is successfully created first before we actually test
343 # 'mkdir -p' feature.
344 if (umask $mkdir_umask &&
345 $mkdirprog $mkdir_mode "$tmpdir" &&
346 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
347 then
348 if test -z "$dir_arg" || {
349 # Check for POSIX incompatibilities with -m.
350 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
351 # other-writable bit of parent directory when it shouldn't.
352 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
353 test_tmpdir="$tmpdir/a"
354 ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
355 case $ls_ld_tmpdir in
356 d????-?r-*) different_mode=700;;
357 d????-?--*) different_mode=755;;
358 *) false;;
359 esac &&
360 $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
361 ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
362 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
363 }
364 }
365 then posix_mkdir=:
366 fi
367 rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
368 else
369 # Remove any dirs left behind by ancient mkdir implementations.
370 rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
371 fi
372 trap '' 0;;
373 esac;;
336 # The $RANDOM variable is not portable (e.g., dash). Use it
337 # here however when possible just to lower collision chance.
338 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
339
340 trap '
341 ret=$?
342 rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
343 exit $ret
344 ' 0
345
346 # Because "mkdir -p" follows existing symlinks and we likely work
347 # directly in world-writeable /tmp, make sure that the '$tmpdir'
348 # directory is successfully created first before we actually test
349 # 'mkdir -p'.
350 if (umask $mkdir_umask &&
351 $mkdirprog $mkdir_mode "$tmpdir" &&
352 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
353 then
354 if test -z "$dir_arg" || {
355 # Check for POSIX incompatibilities with -m.
356 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
357 # other-writable bit of parent directory when it shouldn't.
358 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
359 test_tmpdir="$tmpdir/a"
360 ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
361 case $ls_ld_tmpdir in
362 d????-?r-*) different_mode=700;;
363 d????-?--*) different_mode=755;;
364 *) false;;
365 esac &&
366 $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
367 ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
368 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
369 }
370 }
371 then posix_mkdir=:
372 fi
373 rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
374 else
375 # Remove any dirs left behind by ancient mkdir implementations.
376 rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
377 fi
378 trap '' 0;;
374379 esac
375380
376381 if
381386 then :
382387 else
383388
384 # The umask is ridiculous, or mkdir does not conform to POSIX,
389 # mkdir does not conform to POSIX,
385390 # or it failed possibly due to a race condition. Create the
386391 # directory the slow way, step by step, checking for races as we go.
387392
410415 prefixes=
411416 else
412417 if $posix_mkdir; then
413 (umask=$mkdir_umask &&
418 (umask $mkdir_umask &&
414419 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
415420 # Don't fail if two instances are running concurrently.
416421 test -d "$prefix" || exit 1
450455 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
451456
452457 # Copy the file name to the temp name.
453 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
458 (umask $cp_umask &&
459 { test -z "$stripcmd" || {
460 # Create $dsttmp read-write so that cp doesn't create it read-only,
461 # which would cause strip to fail.
462 if test -z "$doit"; then
463 : >"$dsttmp" # No need to fork-exec 'touch'.
464 else
465 $doit touch "$dsttmp"
466 fi
467 }
468 } &&
469 $doit_exec $cpprog "$src" "$dsttmp") &&
454470
455471 # and set any options; do chmod last to preserve setuid bits.
456472 #
476492 then
477493 rm -f "$dsttmp"
478494 else
495 # If $backupsuffix is set, and the file being installed
496 # already exists, attempt a backup. Don't worry if it fails,
497 # e.g., if mv doesn't support -f.
498 if test -n "$backupsuffix" && test -f "$dst"; then
499 $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
500 fi
501
479502 # Rename the file to the real destination.
480503 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
481504
490513 # file should still install successfully.
491514 {
492515 test ! -f "$dst" ||
493 $doit $rmcmd -f "$dst" 2>/dev/null ||
516 $doit $rmcmd "$dst" 2>/dev/null ||
494517 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
495 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
518 { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
496519 } ||
497520 { echo "$0: cannot unlink or rename $dst" >&2
498521 (exit 1); exit 1
1717 x86/cpuid.h
1818
1919 SRC_FONTCONFIG = ass_fontconfig.c ass_fontconfig.h
20 SRC_DIRECTWRITE = ass_directwrite.c ass_directwrite.h dwrite_c.h
20 SRC_DIRECTWRITE = ass_directwrite.c ass_directwrite.h ass_directwrite_info_template.h dwrite_c.h
2121 SRC_CORETEXT = ass_coretext.c ass_coretext.h
2222
2323 lib_LTLIBRARIES = libass.la
0 # Makefile.in generated by automake 1.16.1 from Makefile.am.
0 # Makefile.in generated by automake 1.16.4 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2021 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
146146 ass_drawing.h ass_drawing.c ass_rasterizer.h ass_rasterizer.c \
147147 ass_rasterizer_c.c ass_bitmap.h ass_bitmap.c ass_blur.c \
148148 ass_func_template.h ass_fontconfig.c ass_fontconfig.h \
149 ass_directwrite.c ass_directwrite.h dwrite_c.h ass_coretext.c \
149 ass_directwrite.c ass_directwrite.h \
150 ass_directwrite_info_template.h dwrite_c.h ass_coretext.c \
150151 ass_coretext.h x86/rasterizer.asm x86/blend_bitmaps.asm \
151152 x86/be_blur.asm x86/blur.asm x86/cpuid.asm x86/cpuid.h
152153 am__objects_1 = ass_fontconfig.lo
243244 unique=`for i in $$list; do \
244245 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
245246 done | $(am__uniquify_input)`
246 ETAGS = etags
247 CTAGS = ctags
248247 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
249248 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
250249 ACLOCAL = @ACLOCAL@
262261 CFLAGS = @CFLAGS@
263262 CPP = @CPP@
264263 CPPFLAGS = @CPPFLAGS@
264 CSCOPE = @CSCOPE@
265 CTAGS = @CTAGS@
265266 CYGPATH_W = @CYGPATH_W@
266267 DEFS = @DEFS@
267268 DEPDIR = @DEPDIR@
272273 ECHO_N = @ECHO_N@
273274 ECHO_T = @ECHO_T@
274275 EGREP = @EGREP@
276 ETAGS = @ETAGS@
275277 EXEEXT = @EXEEXT@
276278 FGREP = @FGREP@
277279 FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
373375 prefix = @prefix@
374376 program_transform_name = @program_transform_name@
375377 psdir = @psdir@
378 runstatedir = @runstatedir@
376379 sbindir = @sbindir@
377380 sharedstatedir = @sharedstatedir@
378381 srcdir = @srcdir@
396399 x86/cpuid.h
397400
398401 SRC_FONTCONFIG = ass_fontconfig.c ass_fontconfig.h
399 SRC_DIRECTWRITE = ass_directwrite.c ass_directwrite.h dwrite_c.h
402 SRC_DIRECTWRITE = ass_directwrite.c ass_directwrite.h ass_directwrite_info_template.h dwrite_c.h
400403 SRC_CORETEXT = ass_coretext.c ass_coretext.h
401404 lib_LTLIBRARIES = libass.la
402405 libass_la_SOURCES = ass.h ass.c ass_types.h ass_utils.h ass_utils.c \
636639
637640 distclean-tags:
638641 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
639
640642 distdir: $(BUILT_SOURCES)
641643 $(MAKE) $(AM_MAKEFLAGS) distdir-am
642644
125125 return ret;
126126 }
127127
128 static bool fill_family_name(CTFontDescriptorRef fontd,
129 ASS_FontProviderMetaData *info)
130 {
131 if (info->n_family)
132 return true;
133
134 char *family_name = get_name(fontd, kCTFontFamilyNameAttribute);
135 if (!family_name)
136 return false;
137
138 info->families = malloc(sizeof(char *));
139 if (!info->families) {
140 free(family_name);
141 return false;
142 }
143
144 info->families[0] = family_name;
145 info->n_family++;
146 return true;
147 }
148
149 static bool get_font_info_ct(ASS_Library *lib, FT_Library ftlib,
150 CTFontDescriptorRef fontd,
128 static bool get_font_info_ct(CTFontDescriptorRef fontd,
151129 char **path_out,
152130 ASS_FontProviderMetaData *info)
153131 {
159137 }
160138
161139 char *ps_name = get_name(fontd, kCTFontNameAttribute);
140 info->postscript_name = ps_name;
162141 if (!ps_name)
163142 return false;
164143
165 bool got_info = ass_get_font_info(lib, ftlib, path, ps_name, -1, false, info);
166 free(ps_name);
167
168 return got_info && fill_family_name(fontd, info);
169 }
170
171 static void process_descriptors(ASS_Library *lib, FT_Library ftlib,
172 ASS_FontProvider *provider, CFArrayRef fontsd)
144 char *family_name = get_name(fontd, kCTFontFamilyNameAttribute);
145 info->extended_family = family_name;
146 if (!family_name)
147 return false;
148
149 return true;
150 }
151
152 static void process_descriptors(ASS_FontProvider *provider, CFArrayRef fontsd)
173153 {
174154 if (!fontsd)
175155 return;
180160 int index = -1;
181161
182162 char *path = NULL;
183 if (get_font_info_ct(lib, ftlib, fontd, &path, &meta)) {
163 if (get_font_info_ct(fontd, &path, &meta)) {
184164 CFRetain(fontd);
185165 ass_font_provider_add_font(provider, &meta, path, index, (void*)fontd);
186166 }
187167
188 for (int j = 0; j < meta.n_family; j++)
189 free(meta.families[j]);
190
191 for (int j = 0; j < meta.n_fullname; j++)
192 free(meta.fullnames[j]);
193
194 free(meta.families);
195 free(meta.fullnames);
196
197168 free(meta.postscript_name);
169 free(meta.extended_family);
198170
199171 free(path);
200172 }
203175 static void match_fonts(void *priv, ASS_Library *lib, ASS_FontProvider *provider,
204176 char *name)
205177 {
206 FT_Library ftlib = priv;
207
208178 CFStringRef cfname =
209179 CFStringCreateWithCString(NULL, name, kCFStringEncodingUTF8);
210180 if (!cfname)
241211 if (!descriptors)
242212 goto cleanup;
243213
244 ctcoll = CTFontCollectionCreateWithFontDescriptors(descriptors, 0);
214 const int nonzero = 1;
215 CFNumberRef cfnonzero = CFNumberCreate(NULL, kCFNumberIntType, &nonzero);
216 if (!cfnonzero)
217 goto cleanup;
218 CFDictionaryRef options =
219 CFDictionaryCreate(NULL,
220 (const void **)&kCTFontCollectionRemoveDuplicatesOption,
221 (const void **)&cfnonzero,
222 1, NULL, NULL);
223 CFRelease(cfnonzero);
224 if (!options)
225 goto cleanup;
226
227 ctcoll = CTFontCollectionCreateWithFontDescriptors(descriptors, options);
228 CFRelease(options);
245229 if (!ctcoll)
246230 goto cleanup;
247231
249233 if (!fontsd)
250234 goto cleanup;
251235
252 process_descriptors(lib, ftlib, provider, fontsd);
236 process_descriptors(provider, fontsd);
253237
254238 cleanup:
255239 SAFE_CFRelease(fontsd);
265249 static char *get_fallback(void *priv, ASS_Library *lib,
266250 const char *family, uint32_t codepoint)
267251 {
268 FT_Library ftlib = priv;
269
270252 CFStringRef name = CFStringCreateWithBytes(
271253 0, (UInt8 *)family, strlen(family), kCFStringEncodingUTF8, false);
272254 if (!name)
293275 if (!fb)
294276 return NULL;
295277
296 CTFontDescriptorRef fontd = CTFontCopyFontDescriptor(fb);
278 CFStringRef cffamily = CTFontCopyFamilyName(fb);
297279 CFRelease(fb);
298 if (!fontd)
299 return NULL;
300
301 char *res_name = NULL;
302 char *path = NULL;
303 ASS_FontProviderMetaData meta = {0};
304 if (get_font_info_ct(lib, ftlib, fontd, &path, &meta))
305 res_name = meta.families[0];
306
307 CFRelease(fontd);
308
309 for (int i = 1 /* skip res_name */; i < meta.n_family; i++)
310 free(meta.families[i]);
311
312 for (int i = 0; i < meta.n_fullname; i++)
313 free(meta.fullnames[i]);
314
315 free(meta.families);
316 free(meta.fullnames);
317
318 free(meta.postscript_name);
319
320 free(path);
321
322 return res_name;
280 if (!cffamily)
281 return NULL;
282
283 char *res_family = cfstr2buf(cffamily);
284 CFRelease(cffamily);
285
286 return res_family;
323287 }
324288
325289 static void get_substitutions(void *priv, const char *name,
342306 ass_coretext_add_provider(ASS_Library *lib, ASS_FontSelector *selector,
343307 const char *config, FT_Library ftlib)
344308 {
345 return ass_font_provider_new(selector, &coretext_callbacks, ftlib);
346 }
309 return ass_font_provider_new(selector, &coretext_callbacks, NULL);
310 }
2020 #include "ass_compat.h"
2121
2222 #include <initguid.h>
23 #include <ole2.h>
24 #include <shobjidl.h>
23 #include <wchar.h>
2524
2625 #include "dwrite_c.h"
2726
2827 #include "ass_directwrite.h"
2928 #include "ass_utils.h"
3029
31 #define NAME_MAX_LENGTH 256
3230 #define FALLBACK_DEFAULT_FONT L"Arial"
3331
3432 static const ASS_FontMapping font_substitutions[] = {
3735 {"monospace", "Courier New"}
3836 };
3937
38 typedef struct ASS_SharedHDC ASS_SharedHDC;
39
40 #if ASS_WINAPI_DESKTOP
41
42 struct ASS_SharedHDC {
43 HDC hdc;
44 unsigned ref_count;
45 };
46
47 static ASS_SharedHDC *hdc_retain(ASS_SharedHDC *shared_hdc)
48 {
49 shared_hdc->ref_count++;
50 return shared_hdc;
51 }
52
53 static void hdc_release(ASS_SharedHDC *shared_hdc)
54 {
55 if (!--shared_hdc->ref_count) {
56 DeleteDC(shared_hdc->hdc);
57 free(shared_hdc);
58 }
59 }
60
61 #endif
62
4063 /*
4164 * The private data stored for every font, detected by this backend.
4265 */
4366 typedef struct {
67 #if ASS_WINAPI_DESKTOP
68 ASS_SharedHDC *shared_hdc;
69 #endif
4470 IDWriteFont *font;
4571 IDWriteFontFace *face;
4672 IDWriteFontFileStream *stream;
4773 } FontPrivate;
4874
4975 typedef struct {
76 #if ASS_WINAPI_DESKTOP
5077 HMODULE directwrite_lib;
78 #endif
5179 IDWriteFactory *factory;
5280 IDWriteGdiInterop *gdi_interop;
5381 } ProviderPrivate;
376404 if (code == 0)
377405 return true;
378406
379 hr = IDWriteFont_HasCharacter(priv->font, code, &exists);
380 if (FAILED(hr))
381 return false;
407 if (priv->font) {
408 hr = IDWriteFont_HasCharacter(priv->font, code, &exists);
409 if (FAILED(hr))
410 return false;
411 } else {
412 uint16_t glyph_index;
413 hr = IDWriteFontFace_GetGlyphIndices(priv->face, &code, 1, &glyph_index);
414 if (FAILED(hr))
415 return false;
416 exists = !!glyph_index;
417 }
382418
383419 return exists;
384420 }
391427 ProviderPrivate *provider_priv = (ProviderPrivate *)priv;
392428 provider_priv->gdi_interop->lpVtbl->Release(provider_priv->gdi_interop);
393429 provider_priv->factory->lpVtbl->Release(provider_priv->factory);
430 #if ASS_WINAPI_DESKTOP
394431 FreeLibrary(provider_priv->directwrite_lib);
432 #endif
395433 free(provider_priv);
396434 }
397435
404442 {
405443 FontPrivate *priv = (FontPrivate *) data;
406444
407 IDWriteFont_Release(priv->font);
445 if (priv->font != NULL)
446 IDWriteFont_Release(priv->font);
408447 if (priv->face != NULL)
409448 IDWriteFontFace_Release(priv->face);
410449 if (priv->stream != NULL)
411450 IDWriteFontFileStream_Release(priv->stream);
451
452 #if ASS_WINAPI_DESKTOP
453 hdc_release(priv->shared_hdc);
454 #endif
412455
413456 free(priv);
414457 }
423466 chars[1] = (codepoint & 0x3FF) + 0xDC00;
424467 return 2;
425468 }
469 }
470
471 static char *get_utf8_name(IDWriteLocalizedStrings *names, int k)
472 {
473 wchar_t *temp_name = NULL;
474 char *mbName = NULL;
475
476 UINT32 length;
477 HRESULT hr = IDWriteLocalizedStrings_GetStringLength(names, k, &length);
478 if (FAILED(hr))
479 goto cleanup;
480
481 if (length >= (UINT32) -1 || length + (size_t) 1 > SIZE_MAX / sizeof(wchar_t))
482 goto cleanup;
483
484 temp_name = (wchar_t *) malloc((length + 1) * sizeof(wchar_t));
485 if (!temp_name)
486 goto cleanup;
487
488 hr = IDWriteLocalizedStrings_GetString(names, k, temp_name, length + 1);
489 if (FAILED(hr))
490 goto cleanup;
491
492 int size_needed =
493 WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, NULL, 0, NULL, NULL);
494 if (!size_needed)
495 goto cleanup;
496
497 mbName = (char *) malloc(size_needed);
498 if (!mbName)
499 goto cleanup;
500
501 WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, mbName, size_needed, NULL, NULL);
502
503 cleanup:
504 free(temp_name);
505 return mbName;
426506 }
427507
428508 static char *get_fallback(void *priv, ASS_Library *lib,
471551 IDWriteTextLayout_Release(text_layout);
472552 IDWriteTextFormat_Release(text_format);
473553
554 // DirectWrite may not have found a valid fallback, so check that
555 // the selected font actually has the requested glyph.
556 BOOL exists = FALSE;
557 if (codepoint > 0) {
558 hr = IDWriteFont_HasCharacter(font, codepoint, &exists);
559 if (FAILED(hr) || !exists) {
560 IDWriteFont_Release(font);
561 return NULL;
562 }
563 }
564
474565 // Now, just extract the first family name
475 BOOL exists = FALSE;
476566 IDWriteLocalizedStrings *familyNames = NULL;
477567 hr = IDWriteFont_GetInformationalStrings(font,
478568 DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES,
482572 return NULL;
483573 }
484574
485 wchar_t temp_name[NAME_MAX_LENGTH];
486 hr = IDWriteLocalizedStrings_GetString(familyNames, 0, temp_name, NAME_MAX_LENGTH);
487 if (FAILED(hr)) {
488 IDWriteLocalizedStrings_Release(familyNames);
489 IDWriteFont_Release(font);
490 return NULL;
491 }
492 temp_name[NAME_MAX_LENGTH-1] = 0;
493
494 // DirectWrite may not have found a valid fallback, so check that
495 // the selected font actually has the requested glyph.
496 if (codepoint > 0) {
497 hr = IDWriteFont_HasCharacter(font, codepoint, &exists);
498 if (FAILED(hr) || !exists) {
499 IDWriteLocalizedStrings_Release(familyNames);
500 IDWriteFont_Release(font);
501 return NULL;
502 }
503 }
504
505 int size_needed = WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, NULL, 0,NULL, NULL);
506 char *family = (char *) malloc(size_needed);
507 WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, family, size_needed, NULL, NULL);
575 char *family = get_utf8_name(familyNames, 0);
508576
509577 IDWriteLocalizedStrings_Release(familyNames);
510578 IDWriteFont_Release(font);
528596 }
529597 }
530598
531 static void add_font(IDWriteFont *font, IDWriteFontFamily *fontFamily,
532 ASS_FontProvider *provider)
533 {
534 HRESULT hr;
535 BOOL exists;
536 wchar_t temp_name[NAME_MAX_LENGTH];
537 int size_needed;
599 #define FONT_TYPE IDWriteFontFace3
600 #include "ass_directwrite_info_template.h"
601 #undef FONT_TYPE
602
603 static void add_font_face(IDWriteFontFace *face, ASS_FontProvider *provider,
604 ASS_SharedHDC *shared_hdc)
605 {
538606 ASS_FontProviderMetaData meta = {0};
539607
540 meta.weight = IDWriteFont_GetWeight(font);
541 meta.width = map_width(IDWriteFont_GetStretch(font));
542
543 DWRITE_FONT_STYLE style = IDWriteFont_GetStyle(font);
544 meta.slant = (style == DWRITE_FONT_STYLE_NORMAL) ? FONT_SLANT_NONE :
545 (style == DWRITE_FONT_STYLE_OBLIQUE)? FONT_SLANT_OBLIQUE :
546 (style == DWRITE_FONT_STYLE_ITALIC) ? FONT_SLANT_ITALIC : FONT_SLANT_NONE;
547
548 IDWriteLocalizedStrings *psNames;
549 hr = IDWriteFont_GetInformationalStrings(font,
550 DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_NAME, &psNames, &exists);
551 if (FAILED(hr))
552 goto cleanup;
553
554 if (exists) {
555 hr = IDWriteLocalizedStrings_GetString(psNames, 0, temp_name, NAME_MAX_LENGTH);
556 if (FAILED(hr)) {
557 IDWriteLocalizedStrings_Release(psNames);
608 IDWriteFontFace3 *face3;
609 HRESULT hr = IDWriteFontFace_QueryInterface(face, &IID_IDWriteFontFace3,
610 (void **) &face3);
611 if (SUCCEEDED(hr) && face3) {
612 bool success = get_font_info_IDWriteFontFace3(face3, &meta);
613 IDWriteFontFace3_Release(face3);
614 if (!success)
558615 goto cleanup;
559 }
560
561 temp_name[NAME_MAX_LENGTH-1] = 0;
562 size_needed = WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, NULL, 0, NULL, NULL);
563 char *mbName = (char *) malloc(size_needed);
564 if (!mbName) {
565 IDWriteLocalizedStrings_Release(psNames);
566 goto cleanup;
567 }
568 WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, mbName, size_needed, NULL, NULL);
569 meta.postscript_name = mbName;
570
571 IDWriteLocalizedStrings_Release(psNames);
572 }
573
574 IDWriteLocalizedStrings *fontNames;
575 hr = IDWriteFont_GetInformationalStrings(font,
576 DWRITE_INFORMATIONAL_STRING_FULL_NAME, &fontNames, &exists);
577 if (FAILED(hr))
578 goto cleanup;
579
580 if (exists) {
581 meta.n_fullname = IDWriteLocalizedStrings_GetCount(fontNames);
582 meta.fullnames = (char **) calloc(meta.n_fullname, sizeof(char *));
583 if (!meta.fullnames) {
584 IDWriteLocalizedStrings_Release(fontNames);
585 goto cleanup;
586 }
587 for (int k = 0; k < meta.n_fullname; k++) {
588 hr = IDWriteLocalizedStrings_GetString(fontNames, k,
589 temp_name,
590 NAME_MAX_LENGTH);
591 if (FAILED(hr)) {
592 IDWriteLocalizedStrings_Release(fontNames);
593 goto cleanup;
594 }
595
596 temp_name[NAME_MAX_LENGTH-1] = 0;
597 size_needed = WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, NULL, 0, NULL, NULL);
598 char *mbName = (char *) malloc(size_needed);
599 if (!mbName) {
600 IDWriteLocalizedStrings_Release(fontNames);
601 goto cleanup;
602 }
603 WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, mbName, size_needed, NULL, NULL);
604 meta.fullnames[k] = mbName;
605 }
606 IDWriteLocalizedStrings_Release(fontNames);
607 }
608
609 IDWriteLocalizedStrings *familyNames;
610 hr = IDWriteFont_GetInformationalStrings(font,
611 DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &familyNames, &exists);
612 if (FAILED(hr) || !exists)
613 hr = IDWriteFontFamily_GetFamilyNames(fontFamily, &familyNames);
614 if (FAILED(hr))
615 goto cleanup;
616
617 meta.n_family = IDWriteLocalizedStrings_GetCount(familyNames);
618 meta.families = (char **) calloc(meta.n_family, sizeof(char *));
619 if (!meta.families) {
620 IDWriteLocalizedStrings_Release(familyNames);
621 goto cleanup;
622 }
623 for (int k = 0; k < meta.n_family; k++) {
624 hr = IDWriteLocalizedStrings_GetString(familyNames, k,
625 temp_name,
626 NAME_MAX_LENGTH);
627 if (FAILED(hr)) {
628 IDWriteLocalizedStrings_Release(familyNames);
629 goto cleanup;
630 }
631
632 temp_name[NAME_MAX_LENGTH-1] = 0;
633 size_needed = WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, NULL, 0, NULL, NULL);
634 char *mbName = (char *) malloc(size_needed);
635 if (!mbName) {
636 IDWriteLocalizedStrings_Release(familyNames);
637 goto cleanup;
638 }
639 WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, mbName, size_needed, NULL, NULL);
640 meta.families[k] = mbName;
641 }
642 IDWriteLocalizedStrings_Release(familyNames);
616 }
643617
644618 FontPrivate *font_priv = (FontPrivate *) calloc(1, sizeof(*font_priv));
645619 if (!font_priv)
646620 goto cleanup;
647 font_priv->font = font;
648 font = NULL;
621
622 font_priv->face = face;
623 face = NULL;
624
625 #if ASS_WINAPI_DESKTOP
626 font_priv->shared_hdc = hdc_retain(shared_hdc);
627 #endif
649628
650629 ass_font_provider_add_font(provider, &meta, NULL, 0, font_priv);
651630
664643
665644 free(meta.postscript_name);
666645
646 if (face)
647 IDWriteFontFace_Release(face);
648 }
649
650 #if ASS_WINAPI_DESKTOP
651
652 struct font_enum_priv {
653 ASS_FontProvider *provider;
654 IDWriteGdiInterop *gdi_interop;
655 ASS_SharedHDC *shared_hdc;
656 };
657
658 /*
659 * Windows has three similar functions: EnumFonts, EnumFontFamilies
660 * and EnumFontFamiliesEx, which were introduced at different times.
661 * Each takes a callback, and the declared callback type is the same
662 * for all three. However, the actual arguments passed to the callback
663 * have also changed over time. Some changes match the introduction
664 * of new EnumFont... variants, and some don't. Documentation has
665 * changed over the years, too, so it can be hard to figure out what
666 * types, and when, are safe for the callback to take.
667 *
668 * In the header files, FONTENUMPROC is declared to take:
669 * CONST LOGFONT *, CONST TEXTMETRIC *
670 * These are the baseline structs dating back to 16-bit Windows EnumFont.
671 *
672 * As of 2021, current versions of Microsoft's docs
673 * for the EnumFontFamiliesEx callback use the same:
674 * const LOGFONT *, const TEXTMETRIC *
675 * and for the EnumFontFamilies callback use:
676 * ENUMLOGFONT *, NEWTEXTMETRIC *
677 * and mention that the first "can be cast as" ENUMLOGFONTEX or ENUMLOGFONTEXDV
678 * while the second "can be an ENUMTEXTMETRIC structure" but for
679 * non-TrueType fonts "is a pointer to a TEXTMETRIC structure".
680 *
681 * Docs from the 2000s (which include Win95/98/Me/NT/2000/XP details) use
682 * ENUMLOGFONTEX *, NEWTEXTMETRICEX *
683 * in the EnumFontFamiliesEx callback's definition:
684 * https://web.archive.org/web/20050907052149
685 * /http://msdn.microsoft.com/library/en-us/gdi/fontext_9rmr.asp
686 * and highlight these two extended struct types as advantages over
687 * the EnumFontFamilies callback, suggesting that the actual arguments
688 * to the EnumFontFamiliesEx callback have always been these two extended
689 * structs. This is also reflected in the callback's parameter names
690 * (which have stayed unchanged in the current docs).
691 * EnumFontFamiliesEx itself was added in Windows NT 4.0 and 95.
692 *
693 * Similarly, the EnumFontFamilies callback's parameter names support
694 * the idea that they have always used ENUMLOGFONT and NEWTEXTMETRIC.
695 *
696 * It seems the extra fields in NEWTEXTMETRIC[EX] compared to TEXTMETRIC
697 * are merely zero-filled when they are irrelevant, rather than nonexistent
698 * or inaccessible. This is further supported by the fact the later-still
699 * struct ENUMTEXTMETRIC extends NEWTEXTMETRICEX even though the former
700 * is/was (upon introduction) relevant only to PostScript fonts
701 * while the latter is (supposedly) relevant only to TrueType fonts.
702 *
703 * Docs from the 2000s for ENUMLOGFONTEXDV and ENUMTEXTMETRIC:
704 * https://web.archive.org/web/20050306200105
705 * /http://msdn.microsoft.com/library/en-us/gdi/fontext_15gy.asp
706 * seem to assert that the callback receives these two further-extended
707 * structs *if and only if* running on Windows 2000 or newer.
708 * We don't need them, but if we did, we'd have to check (or assume)
709 * Windows version, because this extension does not seem to have
710 * an associated feature check. Moreover, these structs are given
711 * to the callbacks of all three EnumFont... function variants.
712 * So even EnumFonts actually uses the extended structs in 21st-century
713 * Windows, but the declared callback type can no longer be changed
714 * without breaking existing C++ code due to its strongly-typed pointers.
715 * When targeting modern Windows, though, it seems safe for consumer
716 * code to take the newest structs and cast the function pointer
717 * to the declared callback type.
718 */
719 static int CALLBACK font_enum_proc(const ENUMLOGFONTW *lpelf,
720 const NEWTEXTMETRICW *lpntm,
721 DWORD FontType, LPARAM lParam)
722 {
723 struct font_enum_priv *priv = (struct font_enum_priv *) lParam;
724 HFONT hFont = NULL;
725 HRESULT hr;
726
727 if (FontType & RASTER_FONTTYPE)
728 goto cleanup;
729
730 hFont = CreateFontIndirectW(&lpelf->elfLogFont);
731 if (!hFont)
732 goto cleanup;
733
734 HDC hdc = priv->shared_hdc->hdc;
735 if (!SelectObject(hdc, hFont))
736 goto cleanup;
737
738 wchar_t selected_name[LF_FACESIZE];
739 if (!GetTextFaceW(hdc, LF_FACESIZE, selected_name))
740 goto cleanup;
741 if (wcsncmp(selected_name, lpelf->elfLogFont.lfFaceName, LF_FACESIZE)) {
742 // A different font was selected. This can happen if the requested
743 // name is subject to charset-specific font substitution while
744 // EnumFont... enumerates additional charsets contained in the font.
745 // Alternatively, the font may have disappeared in the meantime.
746 // Either way, there's no use looking at this font any further.
747 goto cleanup;
748 }
749
750 // For single-font files, we could also use GetFontData, but for font
751 // collection files, GDI does not expose the current font index.
752 // CreateFontFaceFromHdc is able to find it out using a private API;
753 // and it may also be more efficient if it doesn't copy the data.
754 // The downside is that we must keep the HDC alive, at least on Windows 7,
755 // to prevent the font from being deleted and breaking the IDWriteFontFace.
756 IDWriteFontFace *face = NULL;
757 hr = IDWriteGdiInterop_CreateFontFaceFromHdc(priv->gdi_interop,
758 hdc, &face);
759 if (FAILED(hr) || !face)
760 goto cleanup;
761
762 add_font_face(face, priv->provider, priv->shared_hdc);
763
764 cleanup:
765 if (hFont)
766 DeleteObject(hFont);
767
768 return 1 /* continue enumerating */;
769 }
770
771 #else
772
773 static void add_font_set(IDWriteFontSet *fontSet, ASS_FontProvider *provider)
774 {
775 UINT32 n = IDWriteFontSet_GetFontCount(fontSet);
776 for (UINT32 i = 0; i < n; i++) {
777 HRESULT hr;
778
779 IDWriteFontFaceReference *faceRef;
780 hr = IDWriteFontSet_GetFontFaceReference(fontSet, i, &faceRef);
781 if (FAILED(hr) || !faceRef)
782 continue;
783
784 if (IDWriteFontFaceReference_GetLocality(faceRef) != DWRITE_LOCALITY_LOCAL)
785 goto cleanup;
786
787 // Simulations for bold or oblique are sometimes synthesized by
788 // DirectWrite. We are only interested in physical fonts.
789 if (IDWriteFontFaceReference_GetSimulations(faceRef) != 0)
790 goto cleanup;
791
792 IDWriteFontFace3 *face;
793 hr = IDWriteFontFaceReference_CreateFontFace(faceRef, &face);
794 if (FAILED(hr) || !face)
795 goto cleanup;
796
797 add_font_face((IDWriteFontFace *) face, provider, NULL);
798
799 cleanup:
800 IDWriteFontFaceReference_Release(faceRef);
801 }
802 }
803
804 #define FONT_TYPE IDWriteFont
805 #define FAMILY_AS_ARG
806 #include "ass_directwrite_info_template.h"
807 #undef FONT_TYPE
808 #undef FAMILY_AS_ARG
809
810 static void add_font(IDWriteFont *font, IDWriteFontFamily *fontFamily,
811 ASS_FontProvider *provider)
812 {
813 ASS_FontProviderMetaData meta = {0};
814 if (!get_font_info_IDWriteFont(font, fontFamily, &meta))
815 goto cleanup;
816
817 FontPrivate *font_priv = (FontPrivate *) calloc(1, sizeof(*font_priv));
818 if (!font_priv)
819 goto cleanup;
820 font_priv->font = font;
821 font = NULL;
822
823 ass_font_provider_add_font(provider, &meta, NULL, 0, font_priv);
824
825 cleanup:
826 if (meta.families) {
827 for (int k = 0; k < meta.n_family; k++)
828 free(meta.families[k]);
829 free(meta.families);
830 }
831
832 if (meta.fullnames) {
833 for (int k = 0; k < meta.n_fullname; k++)
834 free(meta.fullnames[k]);
835 free(meta.fullnames);
836 }
837
838 free(meta.postscript_name);
839
667840 if (font)
668841 IDWriteFont_Release(font);
669842 }
670843
844 #endif
845
671846 /*
672847 * When a new font name is requested, called to load that font from Windows
673848 */
675850 ASS_FontProvider *provider, char *name)
676851 {
677852 ProviderPrivate *provider_priv = (ProviderPrivate *)priv;
678 IDWriteFont *font = NULL;
679 IDWriteFontFamily *fontFamily = NULL;
680 LOGFONTW lf;
681 HRESULT hr = S_OK;
682
683 memset(&lf, 0, sizeof(LOGFONTW));
684 lf.lfWeight = FW_DONTCARE;
685 lf.lfCharSet = DEFAULT_CHARSET;
686 lf.lfOutPrecision = OUT_TT_PRECIS;
687 lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
688 lf.lfQuality = ANTIALIASED_QUALITY;
689 lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
853 LOGFONTW lf = {0};
690854
691855 // lfFaceName can hold up to LF_FACESIZE wchars; truncate longer names
692856 MultiByteToWideChar(CP_UTF8, 0, name, -1, lf.lfFaceName, LF_FACESIZE-1);
693857
694 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(provider_priv->gdi_interop, &lf, &font);
695 if (FAILED(hr) || !font)
858 #if ASS_WINAPI_DESKTOP
859 struct font_enum_priv enum_priv;
860
861 enum_priv.shared_hdc = calloc(1, sizeof(ASS_SharedHDC));
862 if (!enum_priv.shared_hdc)
696863 return;
697864
698 hr = IDWriteFont_GetFontFamily(font, &fontFamily);
699 if (FAILED(hr) || !fontFamily)
700 goto cleanup;
701
702 add_font(font, fontFamily, provider);
703
704 IDWriteFontFamily_Release(fontFamily);
705
706 return;
707
708 cleanup:
709 if (font)
865 // Keep this HDC alive to keep the fonts alive. This seems to be necessary
866 // on Windows 7, where the fonts can't be deleted as long as the DC lives
867 // and where the converted IDWriteFontFaces only work as long as the fonts
868 // aren't deleted, although not on Windows 10, where fonts can be deleted
869 // even if the DC still lives but IDWriteFontFaces keep working even if
870 // the fonts are deleted.
871 //
872 // But beware of threading: docs say CreateCompatibleDC(NULL) creates a DC
873 // that is bound to the current thread and is deleted when the thread dies.
874 // It's not forbidden to call libass functions from multiple threads
875 // over the lifetime of a font provider, so this doesn't work for us.
876 // Practical tests suggest that the docs are wrong and the DC actually
877 // persists after its creating thread dies, but let's not rely on that.
878 // The workaround is to do a longer dance that is effectively equivalent to
879 // CreateCompatibleDC(NULL) but isn't specifically CreateCompatibleDC(NULL).
880 HDC screen_dc = GetDC(NULL);
881 if (!screen_dc) {
882 free(enum_priv.shared_hdc);
883 return;
884 }
885 HDC hdc = CreateCompatibleDC(screen_dc);
886 ReleaseDC(NULL, screen_dc);
887 if (!hdc) {
888 free(enum_priv.shared_hdc);
889 return;
890 }
891
892 enum_priv.provider = provider;
893 enum_priv.gdi_interop = provider_priv->gdi_interop;
894 enum_priv.shared_hdc->hdc = hdc;
895 enum_priv.shared_hdc->ref_count = 1;
896
897 // EnumFontFamilies gives each font once, plus repeats for charset-specific
898 // aliases. EnumFontFamiliesEx gives each charset of each font separately,
899 // so it repeats each font as many times as it has charsets, regardless
900 // of whether they have aliases. Other than this, the two functions are
901 // equivalent. There's no reliable way to distinguish when two items
902 // enumerated by either function refer to the same font (but different
903 // aliases or charsets) or actually distinct fonts, so we add every item
904 // as a separate font to our database and simply prefer the enumeration
905 // function that tends to give fewer duplicates. Generally, many fonts
906 // cover multiple charsets while very few have aliases, so we prefer
907 // EnumFontFamilies.
908 //
909 // Furthermore, the requested name might be an empty string. In this case,
910 // EnumFontFamilies will give us only fonts with empty names, whereas
911 // EnumFontFamiliesEx would give us a list of all installed font families.
912 EnumFontFamiliesW(hdc, lf.lfFaceName,
913 (FONTENUMPROCW) font_enum_proc, (LPARAM) &enum_priv);
914
915 hdc_release(enum_priv.shared_hdc);
916 #else
917 HRESULT hr;
918 IDWriteFactory3 *factory3;
919 hr = IDWriteFactory_QueryInterface(provider_priv->factory,
920 &IID_IDWriteFactory3, (void **) &factory3);
921 if (SUCCEEDED(hr) && factory3) {
922 IDWriteFontSet *fontSet;
923 hr = IDWriteFactory3_GetSystemFontSet(factory3, &fontSet);
924 IDWriteFactory3_Release(factory3);
925 if (FAILED(hr) || !fontSet)
926 return;
927
928 DWRITE_FONT_PROPERTY_ID property_ids[] = {
929 DWRITE_FONT_PROPERTY_ID_WIN32_FAMILY_NAME,
930 DWRITE_FONT_PROPERTY_ID_FULL_NAME,
931 DWRITE_FONT_PROPERTY_ID_POSTSCRIPT_NAME,
932 };
933 for (int i = 0; i < sizeof property_ids / sizeof *property_ids; i++) {
934 DWRITE_FONT_PROPERTY property = {
935 property_ids[i],
936 lf.lfFaceName,
937 L"",
938 };
939
940 IDWriteFontSet *filteredSet;
941 hr = IDWriteFontSet_GetMatchingFonts(fontSet, &property,
942 1, &filteredSet);
943 if (FAILED(hr) || !filteredSet)
944 continue;
945
946 add_font_set(filteredSet, provider);
947
948 IDWriteFontSet_Release(filteredSet);
949 }
950
951 IDWriteFontSet_Release(fontSet);
952 } else {
953 // We must be in Windows 8 WinRT. IDWriteFontSet is not yet
954 // supported, but GDI calls are forbidden. Our only options are
955 // FindFamilyName, CreateFontFromLOGFONT, and eager preloading
956 // of all fonts. The two lazy options are similar, with the
957 // difference that FindFamilyName searches by WWS_FAMILY_NAME
958 // whereas CreateFontFromLOGFONT searches by WIN32_FAMILY_NAME.
959 // The latter is what GDI uses, so pick that. In at least some
960 // versions of Windows, it also searches by FULL_NAME, which is
961 // even better, but it's unclear whether this includes Windows 8.
962 // It never searches by POSTSCRIPT_NAME. This means we won't
963 // find CFF-outline fonts by their PostScript name and may not
964 // find TrueType fonts by their full name; but we can't fix this
965 // without loading the entire font list.
966 lf.lfWeight = FW_DONTCARE;
967 lf.lfCharSet = DEFAULT_CHARSET;
968 lf.lfOutPrecision = OUT_TT_PRECIS;
969 lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
970 lf.lfQuality = ANTIALIASED_QUALITY;
971 lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
972 IDWriteFont *font = NULL;
973 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(provider_priv->gdi_interop,
974 &lf, &font);
975 if (FAILED(hr) || !font)
976 return;
977
978 IDWriteFontFamily *fontFamily = NULL;
979 hr = IDWriteFont_GetFontFamily(font, &fontFamily);
710980 IDWriteFont_Release(font);
711 if (fontFamily)
981 if (FAILED(hr) || !fontFamily)
982 return;
983
984 UINT32 n = IDWriteFontFamily_GetFontCount(fontFamily);
985 for (UINT32 i = 0; i < n; i++) {
986 hr = IDWriteFontFamily_GetFont(fontFamily, i, &font);
987 if (FAILED(hr))
988 continue;
989
990 // Simulations for bold or oblique are sometimes synthesized by
991 // DirectWrite. We are only interested in physical fonts.
992 if (IDWriteFont_GetSimulations(font) != 0) {
993 IDWriteFont_Release(font);
994 continue;
995 }
996
997 add_font(font, fontFamily, provider);
998 }
999
7121000 IDWriteFontFamily_Release(fontFamily);
1001 }
1002 #endif
7131003 }
7141004
7151005 static void get_substitutions(void *priv, const char *name,
7351025 .get_font_index = get_font_index,
7361026 };
7371027
738 typedef HRESULT (WINAPI *DWriteCreateFactoryFn)(
1028 #if ASS_WINAPI_DESKTOP
1029 typedef HRESULT (WINAPI *DWriteCreateFactoryFn)
1030 #else
1031 // LoadLibrary is forbidden in WinRT/UWP apps, so use DirectWrite directly.
1032 // These apps cannot run on older Windows that lacks DirectWrite,
1033 // so we lose nothing.
1034 HRESULT WINAPI DWriteCreateFactory
1035 #endif
1036 (
7391037 DWRITE_FACTORY_TYPE factoryType,
7401038 REFIID iid,
7411039 IUnknown **factory
7561054 IDWriteFactory *dwFactory = NULL;
7571055 IDWriteGdiInterop *dwGdiInterop = NULL;
7581056 ASS_FontProvider *provider = NULL;
759 DWriteCreateFactoryFn DWriteCreateFactoryPtr = NULL;
7601057 ProviderPrivate *priv = NULL;
7611058
1059 #if ASS_WINAPI_DESKTOP
7621060 HMODULE directwrite_lib = LoadLibraryW(L"Dwrite.dll");
7631061 if (!directwrite_lib)
7641062 goto cleanup;
7651063
766 DWriteCreateFactoryPtr =
1064 DWriteCreateFactoryFn DWriteCreateFactory =
7671065 (DWriteCreateFactoryFn)(void *)GetProcAddress(directwrite_lib,
7681066 "DWriteCreateFactory");
769 if (!DWriteCreateFactoryPtr)
770 goto cleanup;
771
772 hr = DWriteCreateFactoryPtr(DWRITE_FACTORY_TYPE_SHARED,
773 &IID_IDWriteFactory,
774 (IUnknown **) (&dwFactory));
1067 if (!DWriteCreateFactory)
1068 goto cleanup;
1069 #endif
1070
1071 hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED,
1072 &IID_IDWriteFactory,
1073 (IUnknown **) (&dwFactory));
7751074 if (FAILED(hr) || !dwFactory) {
7761075 ass_msg(lib, MSGL_WARN, "Failed to initialize directwrite.");
7771076 dwFactory = NULL;
7901089 if (!priv)
7911090 goto cleanup;
7921091
1092 #if ASS_WINAPI_DESKTOP
7931093 priv->directwrite_lib = directwrite_lib;
1094 #endif
7941095 priv->factory = dwFactory;
7951096 priv->gdi_interop = dwGdiInterop;
7961097
8071108 dwGdiInterop->lpVtbl->Release(dwGdiInterop);
8081109 if (dwFactory)
8091110 dwFactory->lpVtbl->Release(dwFactory);
1111 #if ASS_WINAPI_DESKTOP
8101112 if (directwrite_lib)
8111113 FreeLibrary(directwrite_lib);
1114 #endif
8121115
8131116 return NULL;
8141117 }
2121 #ifndef ASS_DIRECTWRITE_H
2222 #define ASS_DIRECTWRITE_H
2323
24 #ifdef WINAPI_FAMILY
25 #include <winapifamily.h>
26 #define ASS_WINAPI_DESKTOP WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
27 #else
28 #define ASS_WINAPI_DESKTOP 1
29 #endif
30
2431 ASS_FontProvider *
2532 ass_directwrite_add_provider(ASS_Library *lib, ASS_FontSelector *selector,
2633 const char *config, FT_Library ftlib);
0 #define CONCAT(a, b) a ## b
1 #define NAME(suffix) CONCAT(get_font_info_, suffix)
2 static bool NAME(FONT_TYPE)(FONT_TYPE *font,
3 #ifdef FAMILY_AS_ARG
4 IDWriteFontFamily *fontFamily,
5 #endif
6 ASS_FontProviderMetaData *meta)
7 #undef NAME
8 #undef CONCAT
9 {
10 HRESULT hr;
11 BOOL exists;
12
13 meta->weight = font->lpVtbl->GetWeight(font);
14 meta->width = map_width(font->lpVtbl->GetStretch(font));
15
16 DWRITE_FONT_STYLE style = font->lpVtbl->GetStyle(font);
17 meta->slant = (style == DWRITE_FONT_STYLE_NORMAL) ? FONT_SLANT_NONE :
18 (style == DWRITE_FONT_STYLE_OBLIQUE)? FONT_SLANT_OBLIQUE :
19 (style == DWRITE_FONT_STYLE_ITALIC) ? FONT_SLANT_ITALIC : FONT_SLANT_NONE;
20
21 IDWriteLocalizedStrings *psNames;
22 hr = font->lpVtbl->GetInformationalStrings(font,
23 DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_NAME, &psNames, &exists);
24 if (FAILED(hr))
25 return false;
26
27 if (exists) {
28 meta->postscript_name = get_utf8_name(psNames, 0);
29 IDWriteLocalizedStrings_Release(psNames);
30 if (!meta->postscript_name)
31 return false;
32 }
33
34 IDWriteLocalizedStrings *fontNames;
35 hr = font->lpVtbl->GetInformationalStrings(font,
36 DWRITE_INFORMATIONAL_STRING_FULL_NAME, &fontNames, &exists);
37 if (FAILED(hr))
38 return false;
39
40 if (exists) {
41 meta->n_fullname = IDWriteLocalizedStrings_GetCount(fontNames);
42 meta->fullnames = (char **) calloc(meta->n_fullname, sizeof(char *));
43 if (!meta->fullnames) {
44 IDWriteLocalizedStrings_Release(fontNames);
45 return false;
46 }
47 for (int k = 0; k < meta->n_fullname; k++) {
48 meta->fullnames[k] = get_utf8_name(fontNames, k);
49 if (!meta->fullnames[k]) {
50 IDWriteLocalizedStrings_Release(fontNames);
51 return false;
52 }
53 }
54 IDWriteLocalizedStrings_Release(fontNames);
55 }
56
57 IDWriteLocalizedStrings *familyNames;
58 hr = font->lpVtbl->GetInformationalStrings(font,
59 DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &familyNames, &exists);
60 if (!FAILED(hr) && !exists) {
61 #ifdef FAMILY_AS_ARG
62 hr = IDWriteFontFamily_GetFamilyNames(fontFamily, &familyNames);
63 #else
64 hr = font->lpVtbl->GetFamilyNames(font, &familyNames);
65 #endif
66 }
67 if (FAILED(hr))
68 return false;
69
70 meta->n_family = IDWriteLocalizedStrings_GetCount(familyNames);
71 meta->families = (char **) calloc(meta->n_family, sizeof(char *));
72 if (!meta->families) {
73 IDWriteLocalizedStrings_Release(familyNames);
74 return false;
75 }
76 for (int k = 0; k < meta->n_family; k++) {
77 meta->families[k] = get_utf8_name(familyNames, k);
78 if (!meta->families[k]) {
79 IDWriteLocalizedStrings_Release(familyNames);
80 return false;
81 }
82 }
83 IDWriteLocalizedStrings_Release(familyNames);
84
85 return true;
86 }
256256
257257 if (lib)
258258 ass_msg(lib, MSGL_V,
259 "Parsed drawing with %d points and %d segments",
259 "Parsed drawing with %zu points and %zu segments",
260260 outline->n_points, outline->n_segments);
261261
262262 drawing_free_tokens(tokens);
129129 }
130130 }
131131
132 FT_Face ass_face_open(ASS_Library *lib, FT_Library ftlib, const char *path,
133 const char *postscript_name, int index)
134 {
135 FT_Face face;
136 int error = FT_New_Face(ftlib, path, index, &face);
137 if (error) {
138 ass_msg(lib, MSGL_WARN, "Error opening font: '%s', %d", path, index);
139 return NULL;
140 }
141
142 if (postscript_name && index < 0 && face->num_faces > 0) {
143 // The font provider gave us a postscript name and is not sure
144 // about the face index.. so use the postscript name to find the
145 // correct face_index in the collection!
146 for (int i = 0; i < face->num_faces; i++) {
147 FT_Done_Face(face);
148 error = FT_New_Face(ftlib, path, i, &face);
149 if (error) {
150 ass_msg(lib, MSGL_WARN, "Error opening font: '%s', %d", path, i);
151 return NULL;
152 }
153
154 const char *face_psname = FT_Get_Postscript_Name(face);
155 if (face_psname != NULL &&
156 strcmp(face_psname, postscript_name) == 0)
157 break;
158 }
159 }
160
161 return face;
162 }
163
132164 static unsigned long
133165 read_stream_font(FT_Stream stream, unsigned long offset, unsigned char *buffer,
134166 unsigned long count)
146178 free(stream);
147179 }
148180
181 FT_Face ass_face_stream(ASS_Library *lib, FT_Library ftlib, const char *name,
182 const ASS_FontStream *stream, int index)
183 {
184 ASS_FontStream *fs = calloc(1, sizeof(ASS_FontStream));
185 if (!fs)
186 return NULL;
187 *fs = *stream;
188
189 FT_Stream ftstream = calloc(1, sizeof(FT_StreamRec));
190 if (!ftstream) {
191 free(fs);
192 return NULL;
193 }
194 ftstream->size = stream->func(stream->priv, NULL, 0, 0);
195 ftstream->read = read_stream_font;
196 ftstream->close = close_stream_font;
197 ftstream->descriptor.pointer = (void *)fs;
198
199 FT_Open_Args args = {
200 .flags = FT_OPEN_STREAM,
201 .stream = ftstream,
202 };
203
204 FT_Face face;
205 int error = FT_Open_Face(ftlib, &args, index, &face);
206 if (error) {
207 if (name) {
208 ass_msg(lib, MSGL_WARN,
209 "Error opening memory font: '%s'", name);
210 } else {
211 ass_msg(lib, MSGL_WARN,
212 "Error opening memory font");
213 }
214 return NULL;
215 }
216
217 return face;
218 }
219
149220 /**
150221 * \brief Select a face with the given charcode and add it to ASS_Font
151222 * \return index of the new face in font->faces, -1 if failed
154225 {
155226 char *path;
156227 char *postscript_name = NULL;
157 int i, index, uid, error;
228 int i, index, uid;
158229 ASS_FontStream stream = { NULL, NULL };
159230 FT_Face face;
160231
161232 if (font->n_faces == ASS_FONT_MAX_FACES)
162233 return -1;
163234
164 path = ass_font_select(fontsel, font->library, font , &index,
235 path = ass_font_select(fontsel, font, &index,
165236 &postscript_name, &uid, &stream, ch);
166237
167238 if (!path)
176247 }
177248
178249 if (stream.func) {
179 FT_Open_Args args;
180 FT_Stream ftstream = calloc(1, sizeof(FT_StreamRec));
181 ASS_FontStream *fs = calloc(1, sizeof(ASS_FontStream));
182
183 *fs = stream;
184 ftstream->size = stream.func(stream.priv, NULL, 0, 0);
185 ftstream->read = read_stream_font;
186 ftstream->close = close_stream_font;
187 ftstream->descriptor.pointer = (void *)fs;
188
189 memset(&args, 0, sizeof(FT_Open_Args));
190 args.flags = FT_OPEN_STREAM;
191 args.stream = ftstream;
192
193 error = FT_Open_Face(font->ftlibrary, &args, index, &face);
194
195 if (error) {
196 ass_msg(font->library, MSGL_WARN,
197 "Error opening memory font: '%s'", path);
198 return -1;
199 }
200
250 face = ass_face_stream(font->library, font->ftlibrary, path,
251 &stream, index);
201252 } else {
202 error = FT_New_Face(font->ftlibrary, path, index, &face);
203 if (error) {
204 ass_msg(font->library, MSGL_WARN,
205 "Error opening font: '%s', %d", path, index);
206 return -1;
207 }
208
209 if (postscript_name && index < 0 && face->num_faces > 0) {
210 // The font provider gave us a post_script name and is not sure
211 // about the face index.. so use the postscript name to find the
212 // correct face_index in the collection!
213 for (int i = 0; i < face->num_faces; i++) {
214 FT_Done_Face(face);
215 error = FT_New_Face(font->ftlibrary, path, i, &face);
216 if (error) {
217 ass_msg(font->library, MSGL_WARN,
218 "Error opening font: '%s', %d", path, i);
219 return -1;
220 }
221
222 const char *face_psname = FT_Get_Postscript_Name(face);
223 if (face_psname != NULL &&
224 strcmp(face_psname, postscript_name) == 0)
225 break;
226 }
227 }
228 }
253 face = ass_face_open(font->library, font->ftlibrary, path,
254 postscript_name, index);
255 }
256
257 if (!face)
258 return -1;
229259
230260 charmap_magic(font->library, face);
231261 set_font_metrics(face);
473503 int face_idx;
474504 ass_msg(font->library, MSGL_INFO,
475505 "Glyph 0x%X not found, selecting one more "
476 "font for (%s, %d, %d)", symbol, font->desc.family,
506 "font for (%.*s, %d, %d)", symbol, (int) font->desc.family.len, font->desc.family.str,
477507 font->desc.bold, font->desc.italic);
478508 face_idx = *face_index = add_face(fontsel, font, symbol);
479509 if (face_idx >= 0) {
490520 }
491521 if (index == 0) {
492522 ass_msg(font->library, MSGL_ERR,
493 "Glyph 0x%X not found in font for (%s, %d, %d)",
494 symbol, font->desc.family, font->desc.bold,
523 "Glyph 0x%X not found in font for (%.*s, %d, %d)",
524 symbol, (int) font->desc.family.len, font->desc.family.str, font->desc.bold,
495525 font->desc.italic);
496526 }
497527 }
6262 ASS_Hinting hinting, int deco);
6363 void ass_font_clear(ASS_Font *font);
6464
65 FT_Face ass_face_open(ASS_Library *lib, FT_Library ftlib, const char *path,
66 const char *postscript_name, int index);
67 FT_Face ass_face_stream(ASS_Library *lib, FT_Library ftlib, const char *name,
68 const ASS_FontStream *stream, int index);
69
6570 #endif /* LIBASS_FONT_H */
8686 {
8787 int i;
8888 FcFontSet *fonts;
89 ASS_FontProviderMetaData meta;
89 ASS_FontProviderMetaData meta = {0};
9090
9191 // get list of fonts
9292 fonts = FcConfigGetFonts(config, FcSetSystem);
165165
166166 // read family names
167167 meta.n_family = 0;
168 while (FcPatternGetString(pat, FC_FAMILY, meta.n_family,
169 (FcChar8 **)&families[meta.n_family]) == FcResultMatch
170 && meta.n_family < MAX_NAME)
168 while (meta.n_family < MAX_NAME &&
169 FcPatternGetString(pat, FC_FAMILY, meta.n_family,
170 (FcChar8 **)&families[meta.n_family]) == FcResultMatch)
171171 meta.n_family++;
172172 meta.families = families;
173173
174174 // read fullnames
175175 meta.n_fullname = 0;
176 while (FcPatternGetString(pat, FC_FULLNAME, meta.n_fullname,
177 (FcChar8 **)&fullnames[meta.n_fullname]) == FcResultMatch
178 && meta.n_fullname < MAX_NAME)
176 while (meta.n_fullname < MAX_NAME &&
177 FcPatternGetString(pat, FC_FULLNAME, meta.n_fullname,
178 (FcChar8 **)&fullnames[meta.n_fullname]) == FcResultMatch)
179179 meta.n_fullname++;
180180 meta.fullnames = fullnames;
181181
7070 char *postscript_name; // can be used as an alternative to index to
7171 // identify a font inside a collection
7272
73 char *extended_family;
74
7375 // font source
7476 ASS_FontProvider *provider;
7577
7880 };
7981
8082 struct font_selector {
83 ASS_Library *library;
84 FT_Library ftlibrary;
85
8186 // uid counter
8287 int uid;
8388
165170 DIR *d = opendir(dir);
166171 if (!d)
167172 return;
173 size_t dirlen = strlen(dir);
174 size_t namemax = 0;
175 char *namebuf = NULL;
168176 while (1) {
169177 struct dirent *entry = readdir(d);
170178 if (!entry)
171179 break;
172180 if (entry->d_name[0] == '.')
173181 continue;
174 char fullname[4096];
175 snprintf(fullname, sizeof(fullname), "%s/%s", dir, entry->d_name);
182 size_t namelen = dirlen + strlen(entry->d_name) + 2u;
183 if (namelen < 2 || namelen - 2 < dirlen)
184 continue;
185 if (namelen > namemax) {
186 size_t newlen = FFMAX(2048, namelen + FFMIN(256, SIZE_MAX - namelen));
187 if (ASS_REALLOC_ARRAY(namebuf, newlen))
188 namemax = newlen;
189 else
190 continue;
191 }
192 snprintf(namebuf, namemax, "%s/%s", dir, entry->d_name);
176193 size_t bufsize = 0;
177 ass_msg(library, MSGL_INFO, "Loading font file '%s'", fullname);
178 void *data = read_file(library, fullname, &bufsize);
194 ass_msg(library, MSGL_INFO, "Loading font file '%s'", namebuf);
195 void *data = read_file(library, namebuf, &bufsize);
179196 if (data) {
180197 ass_add_font(library, entry->d_name, data, bufsize);
181198 free(data);
182199 }
183200 }
201 free(namebuf);
184202 closedir(d);
185203 }
186204
234252 if (info->postscript_name)
235253 free(info->postscript_name);
236254
255 if (info->extended_family)
256 free(info->extended_family);
257 }
258
259 /**
260 * \brief Read basic metadata (names, weight, slant) from a FreeType face,
261 * as required for the FontSelector for matching and sorting.
262 * \param lib FreeType library
263 * \param face FreeType face
264 * \param fallback_family_name family name from outside source, used as last resort
265 * \param info metadata, returned here
266 * \return success
267 */
268 static bool
269 get_font_info(FT_Library lib, FT_Face face, const char *fallback_family_name,
270 ASS_FontProviderMetaData *info)
271 {
272 int i;
273 int num_fullname = 0;
274 int num_family = 0;
275 int num_names = FT_Get_Sfnt_Name_Count(face);
276 int slant, weight;
277 char *fullnames[MAX_FULLNAME];
278 char *families[MAX_FULLNAME];
279
280 // we're only interested in outlines
281 if (!(face->face_flags & FT_FACE_FLAG_SCALABLE))
282 return false;
283
284 for (i = 0; i < num_names; i++) {
285 FT_SfntName name;
286
287 if (FT_Get_Sfnt_Name(face, i, &name))
288 continue;
289
290 if (name.platform_id == TT_PLATFORM_MICROSOFT &&
291 (name.name_id == TT_NAME_ID_FULL_NAME ||
292 name.name_id == TT_NAME_ID_FONT_FAMILY)) {
293 char buf[1024];
294 ass_utf16be_to_utf8(buf, sizeof(buf), (uint8_t *)name.string,
295 name.string_len);
296
297 if (name.name_id == TT_NAME_ID_FULL_NAME && num_fullname < MAX_FULLNAME) {
298 fullnames[num_fullname] = strdup(buf);
299 if (fullnames[num_fullname] == NULL)
300 goto error;
301 num_fullname++;
302 }
303
304 if (name.name_id == TT_NAME_ID_FONT_FAMILY && num_family < MAX_FULLNAME) {
305 families[num_family] = strdup(buf);
306 if (families[num_family] == NULL)
307 goto error;
308 num_family++;
309 }
310 }
311
312 }
313
314 // check if we got a valid family - if not, use
315 // whatever the font provider or FreeType gives us
316 if (num_family == 0 && (fallback_family_name || face->family_name)) {
317 families[0] =
318 strdup(fallback_family_name ? fallback_family_name : face->family_name);
319 if (families[0] == NULL)
320 goto error;
321 num_family++;
322 }
323
324 // we absolutely need a name
325 if (num_family == 0)
326 goto error;
327
328 // calculate sensible slant and weight from style attributes
329 slant = 110 * !!(face->style_flags & FT_STYLE_FLAG_ITALIC);
330 weight = ass_face_get_weight(face);
331
332 // fill our struct
333 info->slant = slant;
334 info->weight = weight;
335 info->width = 100; // FIXME, should probably query the OS/2 table
336
337 info->postscript_name = (char *)FT_Get_Postscript_Name(face);
338
339 if (num_family) {
340 info->families = calloc(sizeof(char *), num_family);
341 if (info->families == NULL)
342 goto error;
343 memcpy(info->families, &families, sizeof(char *) * num_family);
344 info->n_family = num_family;
345 }
346
347 if (num_fullname) {
348 info->fullnames = calloc(sizeof(char *), num_fullname);
349 if (info->fullnames == NULL)
350 goto error;
351 memcpy(info->fullnames, &fullnames, sizeof(char *) * num_fullname);
352 info->n_fullname = num_fullname;
353 }
354
355 return true;
356
357 error:
358 for (i = 0; i < num_family; i++)
359 free(families[i]);
360
361 for (i = 0; i < num_fullname; i++)
362 free(fullnames[i]);
363
364 free(info->families);
365 free(info->fullnames);
366
367 info->families = info->fullnames = NULL;
368 info->n_family = info->n_fullname = 0;
369
370 return false;
371 }
372
373 /**
374 * \brief Free the dynamically allocated fields of metadata
375 * created by get_font_info.
376 * \param meta metadata created by get_font_info
377 */
378 static void free_font_info(ASS_FontProviderMetaData *meta)
379 {
380 if (meta->families) {
381 for (int i = 0; i < meta->n_family; i++)
382 free(meta->families[i]);
383 free(meta->families);
384 }
385
386 if (meta->fullnames) {
387 for (int i = 0; i < meta->n_fullname; i++)
388 free(meta->fullnames[i]);
389 free(meta->fullnames);
390 }
237391 }
238392
239393 /**
253407 int i;
254408 int weight, slant, width;
255409 ASS_FontSelector *selector = provider->parent;
256 ASS_FontInfo *info;
410 ASS_FontInfo *info = NULL;
411 ASS_FontProviderMetaData implicit_meta = {0};
412
413 if (!meta->n_family) {
414 FT_Face face;
415 if (provider->funcs.get_font_index)
416 index = provider->funcs.get_font_index(data);
417 if (!path) {
418 ASS_FontStream stream = {
419 .func = provider->funcs.get_data,
420 .priv = data,
421 };
422 // This name is only used in an error message, so use
423 // our best name but don't panic if we don't have any.
424 // Prefer PostScript name because it is unique.
425 const char *name = meta->postscript_name ?
426 meta->postscript_name : meta->extended_family;
427 face = ass_face_stream(selector->library, selector->ftlibrary,
428 name, &stream, index);
429 } else {
430 face = ass_face_open(selector->library, selector->ftlibrary,
431 path, meta->postscript_name, index);
432 }
433 if (!face)
434 goto error;
435 if (!get_font_info(selector->ftlibrary, face, meta->extended_family,
436 &implicit_meta)) {
437 FT_Done_Face(face);
438 goto error;
439 }
440 if (implicit_meta.postscript_name) {
441 implicit_meta.postscript_name =
442 strdup(implicit_meta.postscript_name);
443 if (!implicit_meta.postscript_name) {
444 FT_Done_Face(face);
445 goto error;
446 }
447 }
448 FT_Done_Face(face);
449 implicit_meta.extended_family = meta->extended_family;
450 meta = &implicit_meta;
451 }
257452
258453 #if 0
259454 int j;
333528 goto error;
334529 }
335530
531 if (meta->extended_family) {
532 info->extended_family = strdup(meta->extended_family);
533 if (info->extended_family == NULL)
534 goto error;
535 }
536
336537 if (path) {
337538 info->path = strdup(path);
338539 if (info->path == NULL)
347548 return true;
348549
349550 error:
350 ass_font_provider_free_fontinfo(info);
551 if (info)
552 ass_font_provider_free_fontinfo(info);
553
554 free_font_info(&implicit_meta);
555 free(implicit_meta.postscript_name);
351556
352557 if (provider->funcs.destroy_font)
353558 provider->funcs.destroy_font(data);
422627 /**
423628 * \brief Return whether the given font is in the given family.
424629 */
425 static bool matches_family_name(ASS_FontInfo *f, const char *family)
630 static bool matches_family_name(ASS_FontInfo *f, const char *family,
631 bool match_extended_family)
426632 {
427633 for (int i = 0; i < f->n_family; i++) {
428634 if (ass_strcasecmp(f->families[i], family) == 0)
635 return true;
636 }
637 if (match_extended_family && f->extended_family) {
638 if (ass_strcasecmp(f->extended_family, family) == 0)
429639 return true;
430640 }
431641 return false;
515725 }
516726
517727 static char *
518 find_font(ASS_FontSelector *priv, ASS_Library *library,
519 ASS_FontProviderMetaData meta, unsigned bold, unsigned italic,
728 find_font(ASS_FontSelector *priv,
729 ASS_FontProviderMetaData meta, bool match_extended_family,
730 unsigned bold, unsigned italic,
520731 int *index, char **postscript_name, int *uid, ASS_FontStream *stream,
521732 uint32_t code, bool *name_match)
522733 {
541752 ASS_FontInfo *font = &priv->font_infos[x];
542753 unsigned score = UINT_MAX;
543754
544 if (matches_family_name(font, fullname)) {
755 if (matches_family_name(font, fullname, match_extended_family)) {
545756 // If there's a family match, compare font attributes
546757 // to determine best match in that particular family
547758 score = font_attributes_similarity(font, &req);
618829 return result;
619830 }
620831
621 static char *select_font(ASS_FontSelector *priv, ASS_Library *library,
622 const char *family, unsigned bold, unsigned italic,
832 static char *select_font(ASS_FontSelector *priv,
833 const char *family, bool match_extended_family,
834 unsigned bold, unsigned italic,
623835 int *index, char **postscript_name, int *uid,
624836 ASS_FontStream *stream, uint32_t code)
625837 {
646858 meta = default_meta;
647859 }
648860
649 result = find_font(priv, library, meta, bold, italic, index,
650 postscript_name, uid, stream, code, &name_match);
861 result = find_font(priv, meta, match_extended_family,
862 bold, italic, index, postscript_name, uid,
863 stream, code, &name_match);
651864
652865 // If no matching font was found, it might not exist in the font list
653866 // yet. Call the match_fonts callback to fill in the missing fonts
658871 // implementations possible.
659872 for (int i = 0; i < meta.n_fullname; i++) {
660873 default_provider->funcs.match_fonts(default_provider->priv,
661 library, default_provider,
874 priv->library, default_provider,
662875 meta.fullnames[i]);
663876 }
664 result = find_font(priv, library, meta, bold, italic, index,
665 postscript_name, uid, stream, code, &name_match);
877 result = find_font(priv, meta, match_extended_family,
878 bold, italic, index, postscript_name, uid,
879 stream, code, &name_match);
666880 }
667881
668882 // cleanup
678892
679893 /**
680894 * \brief Find a font. Use default family or path if necessary.
681 * \param library ASS library handle
682895 * \param family font family
683896 * \param treat_family_as_pattern treat family as fontconfig pattern
684897 * \param bold font weight value
687900 * \param code: the character that should be present in the font, can be 0
688901 * \return font file path
689902 */
690 char *ass_font_select(ASS_FontSelector *priv, ASS_Library *library,
903 char *ass_font_select(ASS_FontSelector *priv,
691904 ASS_Font *font, int *index, char **postscript_name,
692905 int *uid, ASS_FontStream *data, uint32_t code)
693906 {
698911 ASS_FontProvider *default_provider = priv->default_provider;
699912
700913 if (family && *family)
701 res = select_font(priv, library, family, bold, italic, index,
914 res = select_font(priv, family, false, bold, italic, index,
702915 postscript_name, uid, data, code);
703916
704917 if (!res && priv->family_default) {
705 res = select_font(priv, library, priv->family_default, bold,
918 res = select_font(priv, priv->family_default, false, bold,
706919 italic, index, postscript_name, uid, data, code);
707920 if (res)
708 ass_msg(library, MSGL_WARN, "fontselect: Using default "
921 ass_msg(priv->library, MSGL_WARN, "fontselect: Using default "
709922 "font family: (%s, %d, %d) -> %s, %d, %s",
710923 family, bold, italic, res, *index,
711924 *postscript_name ? *postscript_name : "(none)");
716929 if (!search_family || !*search_family)
717930 search_family = "Arial";
718931 char *fallback_family = default_provider->funcs.get_fallback(
719 default_provider->priv, library, search_family, code);
932 default_provider->priv, priv->library, search_family, code);
720933
721934 if (fallback_family) {
722 res = select_font(priv, library, fallback_family, bold, italic,
935 res = select_font(priv, fallback_family, true, bold, italic,
723936 index, postscript_name, uid, data, code);
724937 free(fallback_family);
725938 }
728941 if (!res && priv->path_default) {
729942 res = priv->path_default;
730943 *index = priv->index_default;
731 ass_msg(library, MSGL_WARN, "fontselect: Using default font: "
944 ass_msg(priv->library, MSGL_WARN, "fontselect: Using default font: "
732945 "(%s, %d, %d) -> %s, %d, %s", family, bold, italic,
733946 priv->path_default, *index,
734947 *postscript_name ? *postscript_name : "(none)");
735948 }
736949
737950 if (res)
738 ass_msg(library, MSGL_INFO,
951 ass_msg(priv->library, MSGL_INFO,
739952 "fontselect: (%s, %d, %d) -> %s, %d, %s", family, bold,
740953 italic, res, *index, *postscript_name ? *postscript_name : "(none)");
741954 else
742 ass_msg(library, MSGL_WARN, "fontselect: failed to find any fallback for font: "
955 ass_msg(priv->library, MSGL_WARN,
956 "fontselect: failed to find any fallback for font: "
743957 "(%s, %d, %d)", family, bold, italic);
744958
745959 return res;
746960 }
747961
748
749 /**
750 * \brief Read basic metadata (names, weight, slant) from a FreeType face,
751 * as required for the FontSelector for matching and sorting.
752 * \param lib FreeType library
753 * \param face FreeType face
754 * \param info metadata, returned here
755 * \return success
756 */
757 static bool
758 get_font_info(FT_Library lib, FT_Face face, bool require_family_name,
759 ASS_FontProviderMetaData *info)
760 {
761 int i;
762 int num_fullname = 0;
763 int num_family = 0;
764 int num_names = FT_Get_Sfnt_Name_Count(face);
765 int slant, weight;
766 char *fullnames[MAX_FULLNAME];
767 char *families[MAX_FULLNAME];
768
769 // we're only interested in outlines
770 if (!(face->face_flags & FT_FACE_FLAG_SCALABLE))
771 return false;
772
773 for (i = 0; i < num_names; i++) {
774 FT_SfntName name;
775
776 if (FT_Get_Sfnt_Name(face, i, &name))
777 continue;
778
779 if (name.platform_id == TT_PLATFORM_MICROSOFT &&
780 (name.name_id == TT_NAME_ID_FULL_NAME ||
781 name.name_id == TT_NAME_ID_FONT_FAMILY)) {
782 char buf[1024];
783 ass_utf16be_to_utf8(buf, sizeof(buf), (uint8_t *)name.string,
784 name.string_len);
785
786 if (name.name_id == TT_NAME_ID_FULL_NAME && num_fullname < MAX_FULLNAME) {
787 fullnames[num_fullname] = strdup(buf);
788 if (fullnames[num_fullname] == NULL)
789 goto error;
790 num_fullname++;
791 }
792
793 if (name.name_id == TT_NAME_ID_FONT_FAMILY && num_family < MAX_FULLNAME) {
794 families[num_family] = strdup(buf);
795 if (families[num_family] == NULL)
796 goto error;
797 num_family++;
798 }
799 }
800
801 }
802
803 if (require_family_name) {
804 // check if we got a valid family - if not use whatever FreeType gives us
805 if (num_family == 0 && face->family_name) {
806 families[0] = strdup(face->family_name);
807 if (families[0] == NULL)
808 goto error;
809 num_family++;
810 }
811
812 // we absolutely need a name
813 if (num_family == 0)
814 goto error;
815 }
816
817 // calculate sensible slant and weight from style attributes
818 slant = 110 * !!(face->style_flags & FT_STYLE_FLAG_ITALIC);
819 weight = ass_face_get_weight(face);
820
821 // fill our struct
822 info->slant = slant;
823 info->weight = weight;
824 info->width = 100; // FIXME, should probably query the OS/2 table
825
826 info->postscript_name = (char *)FT_Get_Postscript_Name(face);
827
828 if (num_family) {
829 info->families = calloc(sizeof(char *), num_family);
830 if (info->families == NULL)
831 goto error;
832 memcpy(info->families, &families, sizeof(char *) * num_family);
833 info->n_family = num_family;
834 }
835
836 if (num_fullname) {
837 info->fullnames = calloc(sizeof(char *), num_fullname);
838 if (info->fullnames == NULL)
839 goto error;
840 memcpy(info->fullnames, &fullnames, sizeof(char *) * num_fullname);
841 info->n_fullname = num_fullname;
842 }
843
844 return true;
845
846 error:
847 for (i = 0; i < num_family; i++)
848 free(families[i]);
849
850 for (i = 0; i < num_fullname; i++)
851 free(fullnames[i]);
852
853 free(info->families);
854 free(info->fullnames);
855
856 info->families = info->fullnames = NULL;
857 info->n_family = info->n_fullname = 0;
858
859 return false;
860 }
861
862 bool ass_get_font_info(ASS_Library *lib, FT_Library ftlib, const char *path,
863 const char *postscript_name, int index,
864 bool require_family_name,
865 ASS_FontProviderMetaData *info)
866 {
867 bool ret = false;
868 FT_Face face = NULL;
869 int error = FT_New_Face(ftlib, path, index, &face);
870 if (error) {
871 ass_msg(lib, MSGL_WARN, "Error opening font: '%s', %d", path, index);
872 return false;
873 }
874
875 if (postscript_name && index < 0 && face->num_faces > 0) {
876 // The font provider gave us a postscript name and is not sure
877 // about the face index.. so use the postscript name to find the
878 // correct face_index in the collection!
879 for (int i = 0; i < face->num_faces; i++) {
880 FT_Done_Face(face);
881 error = FT_New_Face(ftlib, path, i, &face);
882 if (error) {
883 ass_msg(lib, MSGL_WARN, "Error opening font: '%s', %d", path, i);
884 return false;
885 }
886
887 const char *face_psname = FT_Get_Postscript_Name(face);
888 if (face_psname != NULL &&
889 strcmp(face_psname, postscript_name) == 0)
890 break;
891 }
892 }
893
894 if (face) {
895 ret = get_font_info(ftlib, face, require_family_name, info);
896 if (ret)
897 info->postscript_name = strdup(info->postscript_name);
898 FT_Done_Face(face);
899 }
900
901 return ret;
902 }
903
904 /**
905 * \brief Free the dynamically allocated fields of metadata
906 * created by get_font_info.
907 * \param meta metadata created by get_font_info
908 */
909 static void free_font_info(ASS_FontProviderMetaData *meta)
910 {
911 int i;
912
913 for (i = 0; i < meta->n_family; i++)
914 free(meta->families[i]);
915
916 for (i = 0; i < meta->n_fullname; i++)
917 free(meta->fullnames[i]);
918
919 free(meta->families);
920 free(meta->fullnames);
921 }
922962
923963 /**
924964 * \brief Process memory font.
925965 * \param priv private data
926 * \param library library object
927 * \param ftlibrary freetype library object
928 * \param idx index of the processed font in library->fontdata
966 * \param idx index of the processed font in priv->library->fontdata
929967 *
930968 * Builds a FontInfo with FreeType and some table reading.
931969 */
932 static void process_fontdata(ASS_FontProvider *priv, ASS_Library *library,
933 FT_Library ftlibrary, int idx)
934 {
970 static void process_fontdata(ASS_FontProvider *priv, int idx)
971 {
972 ASS_FontSelector *selector = priv->parent;
973 ASS_Library *library = selector->library;
974
935975 int rc;
936976 const char *name = library->fontdata[idx].name;
937977 const char *data = library->fontdata[idx].data;
944984 ASS_FontProviderMetaData info;
945985 FontDataFT *ft;
946986
947 rc = FT_New_Memory_Face(ftlibrary, (unsigned char *) data,
987 rc = FT_New_Memory_Face(selector->ftlibrary, (unsigned char *) data,
948988 data_size, face_index, &face);
949989 if (rc) {
950990 ass_msg(library, MSGL_WARN, "Error opening memory font '%s'",
957997 charmap_magic(library, face);
958998
959999 memset(&info, 0, sizeof(ASS_FontProviderMetaData));
960 if (!get_font_info(ftlibrary, face, true, &info)) {
1000 if (!get_font_info(selector->ftlibrary, face, NULL, &info)) {
9611001 ass_msg(library, MSGL_WARN,
9621002 "Error getting metadata for embedded font '%s'", name);
9631003 FT_Done_Face(face);
9891029 /**
9901030 * \brief Create font provider for embedded fonts. This parses the fonts known
9911031 * to the current ASS_Library and adds them to the selector.
992 * \param lib library
9931032 * \param selector font selector
994 * \param ftlib FreeType library - used for querying fonts
9951033 * \return font provider
9961034 */
9971035 static ASS_FontProvider *
998 ass_embedded_fonts_add_provider(ASS_Library *lib, ASS_FontSelector *selector,
999 FT_Library ftlib, size_t *num_emfonts)
1036 ass_embedded_fonts_add_provider(ASS_FontSelector *selector, size_t *num_emfonts)
10001037 {
10011038 ASS_FontProvider *priv = ass_font_provider_new(selector, &ft_funcs, NULL);
10021039 if (priv == NULL)
10031040 return NULL;
10041041
1042 ASS_Library *lib = selector->library;
1043
10051044 if (lib->fonts_dir && lib->fonts_dir[0]) {
10061045 load_fonts_from_dir(lib, lib->fonts_dir);
10071046 }
10081047
10091048 for (size_t i = 0; i < lib->num_fontdata; i++)
1010 process_fontdata(priv, lib, ftlib, i);
1049 process_fontdata(priv, i);
10111050 *num_emfonts = lib->num_fontdata;
10121051
10131052 return priv;
10251064 { ASS_FONTPROVIDER_CORETEXT, &ass_coretext_add_provider, "coretext"},
10261065 #endif
10271066 #ifdef CONFIG_DIRECTWRITE
1028 { ASS_FONTPROVIDER_DIRECTWRITE, &ass_directwrite_add_provider, "directwrite"},
1067 { ASS_FONTPROVIDER_DIRECTWRITE, &ass_directwrite_add_provider, "directwrite"
1068 #if ASS_WINAPI_DESKTOP
1069 " (with GDI)"
1070 #else
1071 " (without GDI)"
1072 #endif
1073 },
10291074 #endif
10301075 #ifdef CONFIG_FONTCONFIG
10311076 { ASS_FONTPROVIDER_FONTCONFIG, &ass_fontconfig_add_provider, "fontconfig"},
10501095 if (priv == NULL)
10511096 return NULL;
10521097
1098 priv->library = library;
1099 priv->ftlibrary = ftlibrary;
10531100 priv->uid = 1;
10541101 priv->family_default = family ? strdup(family) : NULL;
10551102 priv->path_default = path ? strdup(path) : NULL;
10561103 priv->index_default = 0;
10571104
1058 priv->embedded_provider = ass_embedded_fonts_add_provider(library, priv,
1059 ftlibrary, num_emfonts);
1105 priv->embedded_provider = ass_embedded_fonts_add_provider(priv, num_emfonts);
10601106
10611107 if (priv->embedded_provider == NULL) {
10621108 ass_msg(library, MSGL_WARN, "failed to create embedded font provider");
11421188 }
11431189 }
11441190
1145 size_t ass_update_embedded_fonts(ASS_Library *lib, ASS_FontSelector *selector,
1146 FT_Library ftlib, size_t num_loaded)
1191 size_t ass_update_embedded_fonts(ASS_FontSelector *selector, size_t num_loaded)
11471192 {
11481193 if (!selector->embedded_provider)
11491194 return num_loaded;
11501195
1151 for (size_t i = num_loaded; i < lib->num_fontdata; i++)
1152 process_fontdata(selector->embedded_provider, lib, ftlib, i);
1153 return lib->num_fontdata;
1154 }
1196 size_t num_fontdata = selector->library->num_fontdata;
1197 for (size_t i = num_loaded; i < num_fontdata; i++)
1198 process_fontdata(selector->embedded_provider, i);
1199 return num_fontdata;
1200 }
2626 typedef struct ass_shaper_font_data ASS_ShaperFontData;
2727 typedef struct font_selector ASS_FontSelector;
2828 typedef struct font_info ASS_FontInfo;
29 typedef struct ass_font_stream ASS_FontStream;
2930
3031 #include "ass_types.h"
3132 #include "ass.h"
131132 ASS_FontProviderMetaData *meta);
132133
133134 /**
134 * Get an appropriate fallback font for a given codepoint.
135 * Get an appropriate fallback extended font family for a given codepoint.
135136 *
136137 * This is called by fontselect whenever a glyph is not found in the
137138 * physical font list of a logical font. fontselect will try to add the
146147 * \param lib ASS_Library instance
147148 * \param family original font family name (try matching a similar font) (never NULL)
148149 * \param codepoint Unicode codepoint (UTF-32)
149 * \return output font family, allocated with malloc(), must be freed
150 * \return output extended font family, allocated with malloc(), must be freed
150151 * by caller.
151152 */
152153 typedef char *(*GetFallbackFunc)(void *priv,
169170 /*
170171 * Basic font metadata. All strings must be encoded with UTF-8.
171172 * At minimum one family is required.
173 * If no family names are present, ass_font_provider_add_font
174 * will open the font file and read metadata from there,
175 * replacing everything but extended_family.
172176 */
173177 struct ass_font_provider_meta_data {
174178 /**
175 * List of localized font family names, e.g. "Arial".
179 * List of localized font family names,
180 * e.g. "Arial", "Arial Narrow" or "Arial Black".
176181 */
177182 char **families;
178183
179184 /**
180 * List of localized full names, e.g. "Arial Bold".
185 * List of localized full names, e.g. "Arial Bold",
186 * "Arial Narrow Bold", "Arial Black" or "Arial Black Normal".
181187 * The English name should be listed first to speed up typical matching.
182188 */
183189 char **fullnames;
184190
185191 /**
186 * The PostScript name, e.g. "Arial-BoldMT".
192 * The PostScript name, e.g. "Arial-BoldMT",
193 * "ArialNarrow-Bold" or "Arial-Black".
187194 */
188195 char *postscript_name;
196
197 /**
198 * Any name that identifies an extended font family, e.g. "Arial".
199 * This could be the full designer-named typographic family or (perhaps
200 * even better) a (sub)family limited to weight/width/slant variations.
201 * Names returned by get_fallback are matched against this field.
202 */
203 char *extended_family;
189204
190205 int n_family; // Number of localized family names
191206 int n_fullname; // Number of localized full names
197212 // See FONT_WIDTH_*
198213 };
199214
200 typedef struct ass_font_stream ASS_FontStream;
201
202215 struct ass_font_stream {
203216 // GetDataFunc
204217 size_t (*func)(void *font_priv, unsigned char *data,
231244 ass_fontselect_init(ASS_Library *library, FT_Library ftlibrary, size_t *num_emfonts,
232245 const char *family, const char *path, const char *config,
233246 ASS_DefaultFontProvider dfp);
234 char *ass_font_select(ASS_FontSelector *priv, ASS_Library *library,
247 char *ass_font_select(ASS_FontSelector *priv,
235248 ASS_Font *font, int *index, char **postscript_name,
236249 int *uid, ASS_FontStream *data, uint32_t code);
237250 void ass_fontselect_free(ASS_FontSelector *priv);
269282 int index, void *data);
270283
271284 /**
272 * \brief Read a font's parameters
273 * \param lib a FT_Library to use (need not be the global one)
274 * \param path the path to the font file to read
275 * \param postscript_name the PS name of the specific face to read (set either this or index)
276 * \param index the face index to read, or -1 if not applicable
277 * \param require_family_name whether to try a fallback family name and fail if none found
278 * \param info the struct to store results into
279 * \return success
280 *
281 */
282 bool ass_get_font_info(ASS_Library *lib, FT_Library ftlib, const char *path,
283 const char *postscript_name, int index,
284 bool require_family_name,
285 ASS_FontProviderMetaData *info);
286
287 /**
288285 * \brief Free font provider and associated fonts.
289286 * \param provider the font provider
290287 *
294291 /**
295292 * \brief Update embedded and memory fonts
296293 */
297 size_t ass_update_embedded_fonts(ASS_Library *lib, ASS_FontSelector *selector,
298 FT_Library ftlib, size_t num_loaded);
294 size_t ass_update_embedded_fonts(ASS_FontSelector *selector, size_t num_loaded);
299295
300296 #endif /* LIBASS_FONTSELECT_H */
28772877
28782878 if (render_priv->library->num_fontdata != render_priv->num_emfonts) {
28792879 assert(render_priv->library->num_fontdata > render_priv->num_emfonts);
2880 render_priv->num_emfonts = ass_update_embedded_fonts(render_priv->library,
2881 render_priv->fontselect, render_priv->ftlibrary, render_priv->num_emfonts);
2880 render_priv->num_emfonts = ass_update_embedded_fonts(
2881 render_priv->fontselect, render_priv->num_emfonts);
28822882 }
28832883
28842884 ass_shaper_set_kerning(render_priv->shaper, track->Kerning);
103103 unsigned ass_utf8_get_char(char **str);
104104 unsigned ass_utf8_put_char(char *dest, uint32_t ch);
105105 void ass_utf16be_to_utf8(char *dst, size_t dst_size, uint8_t *src, size_t src_size);
106 #if defined(__MINGW32__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
107 __attribute__ ((format (gnu_printf, 3, 4)))
108 #elif defined(__GNUC__)
109 __attribute__ ((format (printf, 3, 4)))
110 #endif
106111 void ass_msg(ASS_Library *priv, int lvl, const char *fmt, ...);
107112 int lookup_style(ASS_Track *track, char *name);
108113 ASS_Style *lookup_style_strict(ASS_Track *track, char *name, size_t len);
1414 #include <unknwn.h>
1515
1616 typedef struct IDWriteFactory IDWriteFactory;
17 typedef struct IDWriteFactory3 IDWriteFactory3;
1718 typedef struct IDWriteFont IDWriteFont;
1819 typedef struct IDWriteFontCollection IDWriteFontCollection;
1920 typedef struct IDWriteFontFace IDWriteFontFace;
21 typedef struct IDWriteFontFace3 IDWriteFontFace3;
22 typedef struct IDWriteFontFaceReference IDWriteFontFaceReference;
2023 typedef struct IDWriteFontFamily IDWriteFontFamily;
2124 typedef struct IDWriteFontList IDWriteFontList;
2225 typedef struct IDWriteFontFile IDWriteFontFile;
2326 typedef struct IDWriteFontFileLoader IDWriteFontFileLoader;
2427 typedef struct IDWriteFontFileStream IDWriteFontFileStream;
28 typedef struct IDWriteFontSet IDWriteFontSet;
2529 typedef struct IDWriteInlineObject IDWriteInlineObject;
2630 typedef struct IDWriteLocalizedStrings IDWriteLocalizedStrings;
2731 typedef struct IDWritePixelSnapping IDWritePixelSnapping;
7074 DWRITE_FONT_FACE_TYPE_RAW_CFF
7175 } DWRITE_FONT_FACE_TYPE;
7276
77 typedef enum DWRITE_FONT_PROPERTY_ID {
78 DWRITE_FONT_PROPERTY_ID_NONE = 0,
79 DWRITE_FONT_PROPERTY_ID_WEIGHT_STRETCH_STYLE_FAMILY_NAME,
80 DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FAMILY_NAME,
81 DWRITE_FONT_PROPERTY_ID_WEIGHT_STRETCH_STYLE_FACE_NAME,
82 DWRITE_FONT_PROPERTY_ID_FULL_NAME,
83 DWRITE_FONT_PROPERTY_ID_WIN32_FAMILY_NAME,
84 DWRITE_FONT_PROPERTY_ID_POSTSCRIPT_NAME,
85 DWRITE_FONT_PROPERTY_ID_DESIGN_SCRIPT_LANGUAGE_TAG,
86 DWRITE_FONT_PROPERTY_ID_SUPPORTED_SCRIPT_LANGUAGE_TAG,
87 DWRITE_FONT_PROPERTY_ID_SEMANTIC_TAG,
88 DWRITE_FONT_PROPERTY_ID_WEIGHT,
89 DWRITE_FONT_PROPERTY_ID_STRETCH,
90 DWRITE_FONT_PROPERTY_ID_STYLE,
91 DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FACE_NAME,
92 /* rest dropped */
93 } DWRITE_FONT_PROPERTY_ID;
94
7395 typedef enum DWRITE_FONT_SIMULATIONS {
7496 DWRITE_FONT_SIMULATIONS_NONE = 0x0000,
7597 DWRITE_FONT_SIMULATIONS_BOLD = 0x0001,
101123 /* rest dropped */
102124 } DWRITE_FONT_WEIGHT;
103125
126 typedef enum DWRITE_LOCALITY {
127 DWRITE_LOCALITY_REMOTE = 0,
128 DWRITE_LOCALITY_PARTIAL,
129 DWRITE_LOCALITY_LOCAL
130 } DWRITE_LOCALITY;
131
104132 typedef struct DWRITE_FONT_METRICS {
105133 UINT16 designUnitsPerEm;
106134 UINT16 ascent;
114142 UINT16 strikethroughThickness;
115143 } DWRITE_FONT_METRICS;
116144
145 typedef struct DWRITE_FONT_PROPERTY {
146 DWRITE_FONT_PROPERTY_ID propertyId;
147 const WCHAR *propertyValue;
148 const WCHAR *localeName;
149 } DWRITE_FONT_PROPERTY;
150
117151 typedef struct DWRITE_GLYPH_OFFSET DWRITE_GLYPH_OFFSET;
118152
119153 typedef struct DWRITE_GLYPH_RUN {
191225 IDWriteTextFormat **textFormat) PURE;
192226
193227 STDMETHOD(dummy12)(THIS);
228
194229 STDMETHOD(GetGdiInterop)(THIS_
195230 IDWriteGdiInterop **gdiInterop) PURE;
196231
213248 #define IDWriteFactory_CreateTextFormat(This,fontFamilyName,fontCollection,fontWeight,fontStyle,fontStretch,fontSize,localeName,textFormat) (This)->lpVtbl->CreateTextFormat(This,fontFamilyName,fontCollection,fontWeight,fontStyle,fontStretch,fontSize,localeName,textFormat)
214249 #define IDWriteFactory_CreateTextLayout(This,string,stringLength,textFormat,maxWidth,maxHeight,textLayout) (This)->lpVtbl->CreateTextLayout(This,string,stringLength,textFormat,maxWidth,maxHeight,textLayout)
215250 #define IDWriteFactory_GetGdiInterop(This,gdiInterop) (This)->lpVtbl->GetGdiInterop(This,gdiInterop)
251 #endif /*COBJMACROS*/
252
253 #undef INTERFACE
254 #define INTERFACE IDWriteFactory3
255 DECLARE_INTERFACE_(IDWriteFactory3,IDWriteFactory)
256 {
257 BEGIN_INTERFACE
258
259 #ifndef __cplusplus
260 /* IUnknown methods */
261 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
262 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
263 STDMETHOD_(ULONG, Release)(THIS) PURE;
264
265 /* IDWriteFactory methods */
266 STDMETHOD(GetSystemFontCollection)(THIS_
267 IDWriteFontCollection **fontCollection,
268 BOOL checkForUpdates __MINGW_DEF_ARG_VAL(FALSE)) PURE;
269
270 STDMETHOD(dummy1)(THIS);
271 STDMETHOD(dummy2)(THIS);
272 STDMETHOD(dummy3)(THIS);
273 STDMETHOD(dummy4)(THIS);
274 STDMETHOD(dummy5)(THIS);
275 STDMETHOD(dummy6)(THIS);
276 STDMETHOD(dummy7)(THIS);
277 STDMETHOD(dummy8)(THIS);
278 STDMETHOD(dummy9)(THIS);
279 STDMETHOD(dummy10)(THIS);
280 STDMETHOD(dummy11)(THIS);
281
282 STDMETHOD(CreateTextFormat)(THIS_
283 WCHAR const *fontFamilyName,
284 IDWriteFontCollection *fontCollection,
285 DWRITE_FONT_WEIGHT fontWeight,
286 DWRITE_FONT_STYLE fontStyle,
287 DWRITE_FONT_STRETCH fontStretch,
288 FLOAT fontSize,
289 WCHAR const *localeName,
290 IDWriteTextFormat **textFormat) PURE;
291
292 STDMETHOD(dummy12)(THIS);
293
294 STDMETHOD(GetGdiInterop)(THIS_
295 IDWriteGdiInterop **gdiInterop) PURE;
296
297 STDMETHOD(CreateTextLayout)(THIS_
298 WCHAR const *string,
299 UINT32 stringLength,
300 IDWriteTextFormat *textFormat,
301 FLOAT maxWidth,
302 FLOAT maxHeight,
303 IDWriteTextLayout **textLayout) PURE;
304 #endif
305
306 STDMETHOD(dummy13)(THIS);
307 STDMETHOD(dummy14)(THIS);
308 STDMETHOD(dummy15)(THIS);
309 STDMETHOD(dummy16)(THIS);
310 STDMETHOD(dummy17)(THIS);
311
312 /* IDWriteFactory1 methods */
313 STDMETHOD(dummy18)(THIS);
314 STDMETHOD(dummy19)(THIS);
315
316 /* IDWriteFactory2 methods */
317 STDMETHOD(dummy20)(THIS);
318 STDMETHOD(dummy21)(THIS);
319 STDMETHOD(dummy22)(THIS);
320 STDMETHOD(dummy23)(THIS);
321 STDMETHOD(dummy24)(THIS);
322
323 /* IDWriteFactory3 methods */
324 STDMETHOD(dummy25)(THIS);
325 STDMETHOD(dummy26)(THIS);
326 STDMETHOD(dummy27)(THIS);
327 STDMETHOD(dummy28)(THIS);
328
329 STDMETHOD(GetSystemFontSet)(THIS_
330 IDWriteFontSet **fontSet) PURE;
331
332 /* rest dropped */
333 END_INTERFACE
334 };
335 #ifdef COBJMACROS
336 #define IDWriteFactory3_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
337 #define IDWriteFactory3_AddRef(This) (This)->lpVtbl->AddRef(This)
338 #define IDWriteFactory3_Release(This) (This)->lpVtbl->Release(This)
339 #define IDWriteFactory3_GetSystemFontCollection(This,fontCollection,checkForUpdates) (This)->lpVtbl->GetSystemFontCollection(This,fontCollection,checkForUpdates)
340 #define IDWriteFactory3_CreateTextFormat(This,fontFamilyName,fontCollection,fontWeight,fontStyle,fontStretch,fontSize,localeName,textFormat) (This)->lpVtbl->CreateTextFormat(This,fontFamilyName,fontCollection,fontWeight,fontStyle,fontStretch,fontSize,localeName,textFormat)
341 #define IDWriteFactory3_CreateTextLayout(This,string,stringLength,textFormat,maxWidth,maxHeight,textLayout) (This)->lpVtbl->CreateTextLayout(This,string,stringLength,textFormat,maxWidth,maxHeight,textLayout)
342 #define IDWriteFactory3_GetGdiInterop(This,gdiInterop) (This)->lpVtbl->GetGdiInterop(This,gdiInterop)
343 #define IDWriteFactory3_GetSystemFontSet(This,fontSet) (This)->lpVtbl->GetSystemFontSet(This,fontSet)
216344 #endif /*COBJMACROS*/
217345
218346 #undef INTERFACE
339467
340468 STDMETHOD_(UINT32, GetIndex)(THIS) PURE;
341469
470 STDMETHOD(dummy1)(THIS);
471 STDMETHOD(dummy2)(THIS);
472 STDMETHOD(dummy3)(THIS);
473 STDMETHOD(dummy4)(THIS);
474 STDMETHOD(dummy5)(THIS);
475
476 STDMETHOD(GetGlyphIndices)(THIS_
477 UINT32 const *codePoints,
478 UINT32 codePointCount,
479 UINT16 *glyphIndices) PURE;
480
342481 /* rest dropped */
343482 END_INTERFACE
344483 };
345484 #ifdef COBJMACROS
485 #define IDWriteFontFace_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
486 #define IDWriteFontFace_AddRef(This) (This)->lpVtbl->AddRef(This)
346487 #define IDWriteFontFace_Release(This) (This)->lpVtbl->Release(This)
347488 #define IDWriteFontFace_GetType(This) (This)->lpVtbl->GetType(This)
348 #define IDWriteFontFace_GetFiles(This,fontFiles,b) (This)->lpVtbl->GetFiles(This,fontFiles,b)
489 #define IDWriteFontFace_GetFiles(This,numberOfFiles,fontFiles) (This)->lpVtbl->GetFiles(This,numberOfFiles,fontFiles)
349490 #define IDWriteFontFace_GetIndex(This) (This)->lpVtbl->GetIndex(This)
491 #define IDWriteFontFace_GetGlyphIndices(This,codePoints,codePointCount,glyphIndices) (This)->lpVtbl->GetGlyphIndices(This,codePoints,codePointCount,glyphIndices)
492 #endif /*COBJMACROS*/
493
494 #undef INTERFACE
495 #define INTERFACE IDWriteFontFace3
496 DECLARE_INTERFACE_(IDWriteFontFace3,IDWriteFontFace)
497 {
498 BEGIN_INTERFACE
499
500 #ifndef __cplusplus
501 /* IUnknown methods */
502 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
503 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
504 STDMETHOD_(ULONG, Release)(THIS) PURE;
505
506 /* IDWriteFontFace methods */
507 STDMETHOD_(DWRITE_FONT_FACE_TYPE, GetType)(THIS) PURE;
508
509 STDMETHOD(GetFiles)(THIS_
510 UINT32 *numberOfFiles,
511 IDWriteFontFile **fontFiles) PURE;
512
513 STDMETHOD_(UINT32, GetIndex)(THIS) PURE;
514
515 STDMETHOD(dummy1)(THIS);
516 STDMETHOD(dummy2)(THIS);
517 STDMETHOD(dummy3)(THIS);
518 STDMETHOD(dummy4)(THIS);
519 STDMETHOD(dummy5)(THIS);
520
521 STDMETHOD(GetGlyphIndices)(THIS_
522 UINT32 const *codePoints,
523 UINT32 codePointCount,
524 UINT16 *glyphIndices) PURE;
525
526 STDMETHOD(dummy6)(THIS);
527 STDMETHOD(dummy7)(THIS);
528 STDMETHOD(dummy8)(THIS);
529 STDMETHOD(dummy9)(THIS);
530 STDMETHOD(dummy10)(THIS);
531 STDMETHOD(dummy11)(THIS);
532 #endif
533
534 /* IDWriteFontFace1 methods */
535 STDMETHOD(dummy12)(THIS);
536 STDMETHOD(dummy13)(THIS);
537 STDMETHOD(dummy14)(THIS);
538 STDMETHOD(dummy15)(THIS);
539 STDMETHOD(dummy16)(THIS);
540 STDMETHOD(dummy17)(THIS);
541 STDMETHOD(dummy18)(THIS);
542 STDMETHOD(dummy19)(THIS);
543 STDMETHOD(dummy20)(THIS);
544 STDMETHOD(dummy21)(THIS);
545 STDMETHOD(dummy22)(THIS);
546 STDMETHOD(dummy23)(THIS);
547
548 /* IDWriteFontFace2 methods */
549 STDMETHOD(dummy24)(THIS);
550 STDMETHOD(dummy25)(THIS);
551 STDMETHOD(dummy26)(THIS);
552 STDMETHOD(dummy27)(THIS);
553 STDMETHOD(dummy28)(THIS);
554
555 /* IDWriteFontFace3 methods */
556 STDMETHOD(dummy29)(THIS);
557 STDMETHOD(dummy30)(THIS);
558
559 STDMETHOD_(DWRITE_FONT_WEIGHT, GetWeight)(THIS) PURE;
560 STDMETHOD_(DWRITE_FONT_STRETCH, GetStretch)(THIS) PURE;
561 STDMETHOD_(DWRITE_FONT_STYLE, GetStyle)(THIS) PURE;
562
563 STDMETHOD(GetFamilyNames)(THIS_
564 IDWriteLocalizedStrings **names) PURE;
565
566 STDMETHOD(dummy31)(THIS);
567
568 STDMETHOD(GetInformationalStrings)(THIS_
569 DWRITE_INFORMATIONAL_STRING_ID informationalStringID,
570 IDWriteLocalizedStrings **informationalStrings,
571 BOOL *exists) PURE;
572
573 /* rest dropped */
574 END_INTERFACE
575 };
576 #ifdef COBJMACROS
577 #define IDWriteFontFace3_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
578 #define IDWriteFontFace3_AddRef(This) (This)->lpVtbl->AddRef(This)
579 #define IDWriteFontFace3_Release(This) (This)->lpVtbl->Release(This)
580 #define IDWriteFontFace3_GetType(This) (This)->lpVtbl->GetType(This)
581 #define IDWriteFontFace3_GetFiles(This,numberOfFiles,fontFiles) (This)->lpVtbl->GetFiles(This,numberOfFiles,fontFiles)
582 #define IDWriteFontFace3_GetIndex(This) (This)->lpVtbl->GetIndex(This)
583 #define IDWriteFontFace3_GetGlyphIndices(This,codePoints,codePointCount,glyphIndices) (This)->lpVtbl->GetGlyphIndices(This,codePoints,codePointCount,glyphIndices)
584 #define IDWriteFontFace3_GetWeight(This) (This)->lpVtbl->GetWeight(This)
585 #define IDWriteFontFace3_GetStretch(This) (This)->lpVtbl->GetStretch(This)
586 #define IDWriteFontFace3_GetStyle(This) (This)->lpVtbl->GetStyle(This)
587 #define IDWriteFontFace3_GetFamilyNames(This,names) (This)->lpVtbl->GetFamilyNames(This,names)
588 #define IDWriteFontFace3_GetInformationalStrings(This,informationalStringID,informationalStrings,exists) (This)->lpVtbl->GetInformationalStrings(This,informationalStringID,informationalStrings,exists)
589 #endif /*COBJMACROS*/
590
591 #undef INTERFACE
592 #define INTERFACE IDWriteFontFaceReference
593 DECLARE_INTERFACE_(IDWriteFontFaceReference,IUnknown)
594 {
595 BEGIN_INTERFACE
596
597 #ifndef __cplusplus
598 /* IUnknown methods */
599 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
600 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
601 STDMETHOD_(ULONG, Release)(THIS) PURE;
602 #endif
603
604 STDMETHOD(CreateFontFace)(THIS_
605 IDWriteFontFace3 **fontFace) PURE;
606
607 STDMETHOD(dummy1)(THIS);
608 STDMETHOD(dummy2)(THIS);
609 STDMETHOD(dummy3)(THIS);
610
611 STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)(THIS) PURE;
612
613 STDMETHOD(dummy4)(THIS);
614 STDMETHOD(dummy5)(THIS);
615 STDMETHOD(dummy6)(THIS);
616 STDMETHOD(dummy7)(THIS);
617
618 STDMETHOD_(DWRITE_LOCALITY, GetLocality)(THIS) PURE;
619
620 /* rest dropped */
621 END_INTERFACE
622 };
623 #ifdef COBJMACROS
624 #define IDWriteFontFaceReference_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
625 #define IDWriteFontFaceReference_AddRef(This) (This)->lpVtbl->AddRef(This)
626 #define IDWriteFontFaceReference_Release(This) (This)->lpVtbl->Release(This)
627 #define IDWriteFontFaceReference_CreateFontFace(This,fontFace) (This)->lpVtbl->CreateFontFace(This,fontFace)
628 #define IDWriteFontFaceReference_GetSimulations(This) (This)->lpVtbl->GetSimulations(This)
629 #define IDWriteFontFaceReference_GetLocality(This) (This)->lpVtbl->GetLocality(This)
350630 #endif /*COBJMACROS*/
351631
352632 #undef INTERFACE
487767 #endif /*COBJMACROS*/
488768
489769 #undef INTERFACE
490 #define INTERFACE IDWriteLocalizedStrings
491 DECLARE_INTERFACE_(IDWriteLocalizedStrings,IUnknown)
492 {
493 BEGIN_INTERFACE
494
495 #ifndef __cplusplus
496 /* IUnknown methods */
497 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
498 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
499 STDMETHOD_(ULONG, Release)(THIS) PURE;
500 #endif
501
502 /* IDWriteLocalizedStrings methods */
503 STDMETHOD_(UINT32, GetCount)(THIS) PURE;
770 #define INTERFACE IDWriteFontSet
771 DECLARE_INTERFACE_(IDWriteFontSet,IUnknown)
772 {
773 BEGIN_INTERFACE
774
775 #ifndef __cplusplus
776 /* IUnknown methods */
777 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
778 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
779 STDMETHOD_(ULONG, Release)(THIS) PURE;
780 #endif
781
782 /* IDWriteFontSet methods */
783 STDMETHOD_(UINT32, GetFontCount)(THIS) PURE;
784
785 STDMETHOD(GetFontFaceReference)(THIS_
786 UINT32 listIndex,
787 IDWriteFontFaceReference **fontFaceReference) PURE;
504788
505789 STDMETHOD(dummy1)(THIS);
506790 STDMETHOD(dummy2)(THIS);
507791 STDMETHOD(dummy3)(THIS);
508792 STDMETHOD(dummy4)(THIS);
509
793 STDMETHOD(dummy5)(THIS);
794 STDMETHOD(dummy6)(THIS);
795 STDMETHOD(dummy7)(THIS);
796
797 STDMETHOD(GetMatchingFonts)(THIS_
798 DWRITE_FONT_PROPERTY const *properties,
799 UINT32 propertyCount,
800 IDWriteFontSet **filteredSet) PURE;
801
802 /* rest dropped */
803 END_INTERFACE
804 };
805 #ifdef COBJMACROS
806 #define IDWriteFontSet_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
807 #define IDWriteFontSet_AddRef(This) (This)->lpVtbl->AddRef(This)
808 #define IDWriteFontSet_Release(This) (This)->lpVtbl->Release(This)
809 #define IDWriteFontSet_GetFontCount(This) (This)->lpVtbl->GetFontCount(This)
810 #define IDWriteFontSet_GetFontFaceReference(This,listIndex,fontFaceReference) (This)->lpVtbl->GetFontFaceReference(This,listIndex,fontFaceReference)
811 #define IDWriteFontSet_GetMatchingFonts(This,properties,propertyCount,filteredSet) (This)->lpVtbl->GetMatchingFonts(This,properties,propertyCount,filteredSet)
812 #endif /*COBJMACROS*/
813
814 #undef INTERFACE
815 #define INTERFACE IDWriteLocalizedStrings
816 DECLARE_INTERFACE_(IDWriteLocalizedStrings,IUnknown)
817 {
818 BEGIN_INTERFACE
819
820 #ifndef __cplusplus
821 /* IUnknown methods */
822 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
823 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
824 STDMETHOD_(ULONG, Release)(THIS) PURE;
825 #endif
826
827 /* IDWriteLocalizedStrings methods */
828 STDMETHOD_(UINT32, GetCount)(THIS) PURE;
829
830 STDMETHOD(dummy1)(THIS);
831 STDMETHOD(dummy2)(THIS);
832 STDMETHOD(dummy3)(THIS);
833
834 STDMETHOD(GetStringLength)(THIS_
835 UINT32 index,
836 UINT32 *length) PURE;
510837 STDMETHOD(GetString)(THIS_
511838 UINT32 index,
512839 WCHAR *stringBuffer,
517844 #ifdef COBJMACROS
518845 #define IDWriteLocalizedStrings_Release(This) (This)->lpVtbl->Release(This)
519846 #define IDWriteLocalizedStrings_GetCount(This) (This)->lpVtbl->GetCount(This)
847 #define IDWriteLocalizedStrings_GetStringLength(This,index,length) (This)->lpVtbl->GetStringLength(This,index,length)
520848 #define IDWriteLocalizedStrings_GetString(This,index,stringBuffer,size) (This)->lpVtbl->GetString(This,index,stringBuffer,size)
521849 #endif /*COBJMACROS*/
522850
6981026 STDMETHOD(CreateFontFromLOGFONT)(THIS_
6991027 LOGFONTW const *logFont,
7001028 IDWriteFont **font) PURE;
1029
1030 STDMETHOD(dummy1)(THIS);
1031 STDMETHOD(dummy2)(THIS);
1032
1033 STDMETHOD(CreateFontFaceFromHdc)(THIS_
1034 HDC hdc,
1035 IDWriteFontFace **fontFace) PURE;
7011036 /* rest dropped */
7021037 END_INTERFACE
7031038 };
7061041 #define IDWriteGdiInterop_AddRef(This) (This)->lpVtbl->AddRef(This)
7071042 #define IDWriteGdiInterop_Release(This) (This)->lpVtbl->Release(This)
7081043 #define IDWriteGdiInterop_CreateFontFromLOGFONT(This,logFont,font) (This)->lpVtbl->CreateFontFromLOGFONT(This,logFont,font)
1044 #define IDWriteGdiInterop_CreateFontFaceFromHdc(This,hdc,fontFace) (This)->lpVtbl->CreateFontFaceFromHdc(This,hdc,fontFace)
7091045 #endif /*COBJMACROS*/
7101046
7111047 DEFINE_GUID(IID_IDWriteFactory, 0xb859ee5a,0xd838,0x4b5b,0xa2,0xe8,0x1a,0xdc,0x7d,0x93,0xdb,0x48);
1048 DEFINE_GUID(IID_IDWriteFactory3, 0x9a1b41c3,0xd3bb,0x466a,0x87,0xfc,0xfe,0x67,0x55,0x6a,0x3b,0x65);
1049 DEFINE_GUID(IID_IDWriteFontFace3, 0xd37d7598,0x09be,0x4222,0xa2,0x36,0x20,0x81,0x34,0x1c,0xc1,0xf2);
7121050 DEFINE_GUID(IID_IDWritePixelSnapping, 0xeaf3a2da,0xecf4,0x4d24,0xb6,0x44,0xb3,0x4f,0x68,0x42,0x02,0x4b);
7131051 DEFINE_GUID(IID_IDWriteTextRenderer, 0xef8a8135,0x5cc6,0x45fe,0x88,0x25,0xc5,0xa0,0x72,0x4e,0xb8,0x19);
714 DEFINE_GUID(IID_IDWriteGdiInterop, 0x1edd9491,0x9853,0x4299,0x89,0x8f,0x64,0x32,0x98,0x3b,0x6f,0x3a);
7151052
7161053 #endif /* __INC_DWRITE__ */
3030
3131 PROGRAM=libtool
3232 PACKAGE=libtool
33 VERSION=2.4.6
33 VERSION="2.4.6 Debian-2.4.6-15"
3434 package_revision=2.4.6
3535
3636
386386 # putting '$debug_cmd' at the start of all your functions, you can get
387387 # bash to show function call trace with:
388388 #
389 # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
389 # debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
390390 debug_cmd=${debug_cmd-":"}
391391 exit_cmd=:
392392
13691369 #! /bin/sh
13701370
13711371 # Set a version string for this script.
1372 scriptversion=2014-01-07.03; # UTC
1372 scriptversion=2015-10-07.11; # UTC
13731373
13741374 # A portable, pluggable option parser for Bourne shell.
13751375 # Written by Gary V. Vaughan, 2010
15291529 {
15301530 $debug_cmd
15311531
1532 _G_rc_run_hooks=false
1533
15321534 case " $hookable_fns " in
15331535 *" $1 "*) ;;
15341536 *) func_fatal_error "'$1' does not support hook funcions.n" ;;
15371539 eval _G_hook_fns=\$$1_hooks; shift
15381540
15391541 for _G_hook in $_G_hook_fns; do
1540 eval $_G_hook '"$@"'
1541
1542 # store returned options list back into positional
1543 # parameters for next 'cmd' execution.
1544 eval _G_hook_result=\$${_G_hook}_result
1545 eval set dummy "$_G_hook_result"; shift
1542 if eval $_G_hook '"$@"'; then
1543 # store returned options list back into positional
1544 # parameters for next 'cmd' execution.
1545 eval _G_hook_result=\$${_G_hook}_result
1546 eval set dummy "$_G_hook_result"; shift
1547 _G_rc_run_hooks=:
1548 fi
15461549 done
15471550
1548 func_quote_for_eval ${1+"$@"}
1549 func_run_hooks_result=$func_quote_for_eval_result
1551 $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result
15501552 }
15511553
15521554
15561558 ## --------------- ##
15571559
15581560 # In order to add your own option parsing hooks, you must accept the
1559 # full positional parameter list in your hook function, remove any
1560 # options that you action, and then pass back the remaining unprocessed
1561 # full positional parameter list in your hook function, you may remove/edit
1562 # any options that you action, and then pass back the remaining unprocessed
15611563 # options in '<hooked_function_name>_result', escaped suitably for
1562 # 'eval'. Like this:
1564 # 'eval'. In this case you also must return $EXIT_SUCCESS to let the
1565 # hook's caller know that it should pay attention to
1566 # '<hooked_function_name>_result'. Returning $EXIT_FAILURE signalizes that
1567 # arguments are left untouched by the hook and therefore caller will ignore the
1568 # result variable.
1569 #
1570 # Like this:
15631571 #
15641572 # my_options_prep ()
15651573 # {
15691577 # usage_message=$usage_message'
15701578 # -s, --silent don'\''t print informational messages
15711579 # '
1572 #
1573 # func_quote_for_eval ${1+"$@"}
1574 # my_options_prep_result=$func_quote_for_eval_result
1580 # # No change in '$@' (ignored completely by this hook). There is
1581 # # no need to do the equivalent (but slower) action:
1582 # # func_quote_for_eval ${1+"$@"}
1583 # # my_options_prep_result=$func_quote_for_eval_result
1584 # false
15751585 # }
15761586 # func_add_hook func_options_prep my_options_prep
15771587 #
15801590 # {
15811591 # $debug_cmd
15821592 #
1593 # args_changed=false
1594 #
15831595 # # Note that for efficiency, we parse as many options as we can
15841596 # # recognise in a loop before passing the remainder back to the
15851597 # # caller on the first unrecognised argument we encounter.
15861598 # while test $# -gt 0; do
15871599 # opt=$1; shift
15881600 # case $opt in
1589 # --silent|-s) opt_silent=: ;;
1601 # --silent|-s) opt_silent=:
1602 # args_changed=:
1603 # ;;
15901604 # # Separate non-argument short options:
15911605 # -s*) func_split_short_opt "$_G_opt"
15921606 # set dummy "$func_split_short_opt_name" \
15931607 # "-$func_split_short_opt_arg" ${1+"$@"}
15941608 # shift
1609 # args_changed=:
15951610 # ;;
1596 # *) set dummy "$_G_opt" "$*"; shift; break ;;
1611 # *) # Make sure the first unrecognised option "$_G_opt"
1612 # # is added back to "$@", we could need that later
1613 # # if $args_changed is true.
1614 # set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
15971615 # esac
15981616 # done
15991617 #
1600 # func_quote_for_eval ${1+"$@"}
1601 # my_silent_option_result=$func_quote_for_eval_result
1618 # if $args_changed; then
1619 # func_quote_for_eval ${1+"$@"}
1620 # my_silent_option_result=$func_quote_for_eval_result
1621 # fi
1622 #
1623 # $args_changed
16021624 # }
16031625 # func_add_hook func_parse_options my_silent_option
16041626 #
16101632 # $opt_silent && $opt_verbose && func_fatal_help "\
16111633 # '--silent' and '--verbose' options are mutually exclusive."
16121634 #
1613 # func_quote_for_eval ${1+"$@"}
1614 # my_option_validation_result=$func_quote_for_eval_result
1635 # false
16151636 # }
16161637 # func_add_hook func_validate_options my_option_validation
16171638 #
1618 # You'll alse need to manually amend $usage_message to reflect the extra
1639 # You'll also need to manually amend $usage_message to reflect the extra
16191640 # options you parse. It's preferable to append if you can, so that
16201641 # multiple option parsing hooks can be added safely.
1642
1643
1644 # func_options_finish [ARG]...
1645 # ----------------------------
1646 # Finishing the option parse loop (call 'func_options' hooks ATM).
1647 func_options_finish ()
1648 {
1649 $debug_cmd
1650
1651 _G_func_options_finish_exit=false
1652 if func_run_hooks func_options ${1+"$@"}; then
1653 func_options_finish_result=$func_run_hooks_result
1654 _G_func_options_finish_exit=:
1655 fi
1656
1657 $_G_func_options_finish_exit
1658 }
16211659
16221660
16231661 # func_options [ARG]...
16291667 {
16301668 $debug_cmd
16311669
1632 func_options_prep ${1+"$@"}
1633 eval func_parse_options \
1634 ${func_options_prep_result+"$func_options_prep_result"}
1635 eval func_validate_options \
1636 ${func_parse_options_result+"$func_parse_options_result"}
1637
1638 eval func_run_hooks func_options \
1639 ${func_validate_options_result+"$func_validate_options_result"}
1640
1641 # save modified positional parameters for caller
1642 func_options_result=$func_run_hooks_result
1670 _G_rc_options=false
1671
1672 for my_func in options_prep parse_options validate_options options_finish
1673 do
1674 if eval func_$my_func '${1+"$@"}'; then
1675 eval _G_res_var='$'"func_${my_func}_result"
1676 eval set dummy "$_G_res_var" ; shift
1677 _G_rc_options=:
1678 fi
1679 done
1680
1681 # Save modified positional parameters for caller. As a top-level
1682 # options-parser function we always need to set the 'func_options_result'
1683 # variable (regardless the $_G_rc_options value).
1684 if $_G_rc_options; then
1685 func_options_result=$_G_res_var
1686 else
1687 func_quote_for_eval ${1+"$@"}
1688 func_options_result=$func_quote_for_eval_result
1689 fi
1690
1691 $_G_rc_options
16431692 }
16441693
16451694
16481697 # All initialisations required before starting the option parse loop.
16491698 # Note that when calling hook functions, we pass through the list of
16501699 # positional parameters. If a hook function modifies that list, and
1651 # needs to propogate that back to rest of this script, then the complete
1700 # needs to propagate that back to rest of this script, then the complete
16521701 # modified list must be put in 'func_run_hooks_result' before
1653 # returning.
1702 # returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned).
16541703 func_hookable func_options_prep
16551704 func_options_prep ()
16561705 {
16601709 opt_verbose=false
16611710 opt_warning_types=
16621711
1663 func_run_hooks func_options_prep ${1+"$@"}
1664
1665 # save modified positional parameters for caller
1666 func_options_prep_result=$func_run_hooks_result
1712 _G_rc_options_prep=false
1713 if func_run_hooks func_options_prep ${1+"$@"}; then
1714 _G_rc_options_prep=:
1715 # save modified positional parameters for caller
1716 func_options_prep_result=$func_run_hooks_result
1717 fi
1718
1719 $_G_rc_options_prep
16671720 }
16681721
16691722
16771730
16781731 func_parse_options_result=
16791732
1733 _G_rc_parse_options=false
16801734 # this just eases exit handling
16811735 while test $# -gt 0; do
16821736 # Defer to hook functions for initial option parsing, so they
16831737 # get priority in the event of reusing an option name.
1684 func_run_hooks func_parse_options ${1+"$@"}
1685
1686 # Adjust func_parse_options positional parameters to match
1687 eval set dummy "$func_run_hooks_result"; shift
1738 if func_run_hooks func_parse_options ${1+"$@"}; then
1739 eval set dummy "$func_run_hooks_result"; shift
1740 _G_rc_parse_options=:
1741 fi
16881742
16891743 # Break out of the loop if we already parsed every option.
16901744 test $# -gt 0 || break
16911745
1746 _G_match_parse_options=:
16921747 _G_opt=$1
16931748 shift
16941749 case $_G_opt in
17031758 ;;
17041759
17051760 --warnings|--warning|-W)
1706 test $# = 0 && func_missing_arg $_G_opt && break
1761 if test $# = 0 && func_missing_arg $_G_opt; then
1762 _G_rc_parse_options=:
1763 break
1764 fi
17071765 case " $warning_categories $1" in
17081766 *" $1 "*)
17091767 # trailing space prevents matching last $1 above
17561814 shift
17571815 ;;
17581816
1759 --) break ;;
1817 --) _G_rc_parse_options=: ; break ;;
17601818 -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
1761 *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
1819 *) set dummy "$_G_opt" ${1+"$@"}; shift
1820 _G_match_parse_options=false
1821 break
1822 ;;
17621823 esac
1824
1825 $_G_match_parse_options && _G_rc_parse_options=:
17631826 done
17641827
1765 # save modified positional parameters for caller
1766 func_quote_for_eval ${1+"$@"}
1767 func_parse_options_result=$func_quote_for_eval_result
1828
1829 if $_G_rc_parse_options; then
1830 # save modified positional parameters for caller
1831 func_quote_for_eval ${1+"$@"}
1832 func_parse_options_result=$func_quote_for_eval_result
1833 fi
1834
1835 $_G_rc_parse_options
17681836 }
17691837
17701838
17771845 {
17781846 $debug_cmd
17791847
1848 _G_rc_validate_options=false
1849
17801850 # Display all warnings if -W was not given.
17811851 test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
17821852
1783 func_run_hooks func_validate_options ${1+"$@"}
1853 if func_run_hooks func_validate_options ${1+"$@"}; then
1854 # save modified positional parameters for caller
1855 func_validate_options_result=$func_run_hooks_result
1856 _G_rc_validate_options=:
1857 fi
17841858
17851859 # Bail if the options were screwed!
17861860 $exit_cmd $EXIT_FAILURE
17871861
1788 # save modified positional parameters for caller
1789 func_validate_options_result=$func_run_hooks_result
1862 $_G_rc_validate_options
17901863 }
17911864
17921865
20672140 compiler: $LTCC
20682141 compiler flags: $LTCFLAGS
20692142 linker: $LD (gnu? $with_gnu_ld)
2070 version: $progname (GNU libtool) 2.4.6
2143 version: $progname $scriptversion Debian-2.4.6-15
20712144 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
20722145 autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
20732146
20742147 Report bugs to <bug-libtool@gnu.org>.
2075 GNU libtool home page: <http://www.gnu.org/software/libtool/>.
2148 GNU libtool home page: <http://www.gnu.org/s/libtool/>.
20762149 General help using GNU software: <http://www.gnu.org/gethelp/>."
20772150 exit 0
20782151 }
22692342 nonopt=
22702343 preserve_args=
22712344
2345 _G_rc_lt_options_prep=:
2346
22722347 # Shorthand for --mode=foo, only valid as the first argument
22732348 case $1 in
22742349 clean|clea|cle|cl)
22922367 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
22932368 shift; set dummy --mode uninstall ${1+"$@"}; shift
22942369 ;;
2370 *)
2371 _G_rc_lt_options_prep=false
2372 ;;
22952373 esac
22962374
2297 # Pass back the list of options.
2298 func_quote_for_eval ${1+"$@"}
2299 libtool_options_prep_result=$func_quote_for_eval_result
2375 if $_G_rc_lt_options_prep; then
2376 # Pass back the list of options.
2377 func_quote_for_eval ${1+"$@"}
2378 libtool_options_prep_result=$func_quote_for_eval_result
2379 fi
2380
2381 $_G_rc_lt_options_prep
23002382 }
23012383 func_add_hook func_options_prep libtool_options_prep
23022384
23082390 {
23092391 $debug_cmd
23102392
2393 _G_rc_lt_parse_options=false
2394
23112395 # Perform our own loop to consume as many options as possible in
23122396 # each iteration.
23132397 while test $# -gt 0; do
2398 _G_match_lt_parse_options=:
23142399 _G_opt=$1
23152400 shift
23162401 case $_G_opt in
23852470 func_append preserve_args " $_G_opt"
23862471 ;;
23872472
2388 # An option not handled by this hook function:
2389 *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
2473 # An option not handled by this hook function:
2474 *) set dummy "$_G_opt" ${1+"$@"} ; shift
2475 _G_match_lt_parse_options=false
2476 break
2477 ;;
23902478 esac
2479 $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
23912480 done
23922481
2393
2394 # save modified positional parameters for caller
2395 func_quote_for_eval ${1+"$@"}
2396 libtool_parse_options_result=$func_quote_for_eval_result
2482 if $_G_rc_lt_parse_options; then
2483 # save modified positional parameters for caller
2484 func_quote_for_eval ${1+"$@"}
2485 libtool_parse_options_result=$func_quote_for_eval_result
2486 fi
2487
2488 $_G_rc_lt_parse_options
23972489 }
23982490 func_add_hook func_parse_options libtool_parse_options
23992491
72717363 # -tp=* Portland pgcc target processor selection
72727364 # --sysroot=* for sysroot support
72737365 # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7366 # -specs=* GCC specs files
72747367 # -stdlib=* select c++ std lib with clang
7368 # -fsanitize=* Clang/GCC memory and address sanitizer
7369 # -fuse-ld=* Linker select flags for GCC
7370 # -static-* direct GCC to link specific libraries statically
7371 # -fcilkplus Cilk Plus language extension features for C/C++
72757372 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
72767373 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
7277 -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
7374 -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
7375 -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus)
72787376 func_quote_for_eval "$arg"
72797377 arg=$func_quote_for_eval_result
72807378 func_append compile_command " $arg"
75677665 case $pass in
75687666 dlopen) libs=$dlfiles ;;
75697667 dlpreopen) libs=$dlprefiles ;;
7570 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
7668 link)
7669 libs="$deplibs %DEPLIBS%"
7670 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
7671 ;;
75717672 esac
75727673 fi
75737674 if test lib,dlpreopen = "$linkmode,$pass"; then
78867987 # It is a libtool convenience library, so add in its objects.
78877988 func_append convenience " $ladir/$objdir/$old_library"
78887989 func_append old_convenience " $ladir/$objdir/$old_library"
7990 tmp_libs=
7991 for deplib in $dependency_libs; do
7992 deplibs="$deplib $deplibs"
7993 if $opt_preserve_dup_deps; then
7994 case "$tmp_libs " in
7995 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7996 esac
7997 fi
7998 func_append tmp_libs " $deplib"
7999 done
78898000 elif test prog != "$linkmode" && test lib != "$linkmode"; then
78908001 func_fatal_error "'$lib' is not a convenience library"
78918002 fi
7892 tmp_libs=
7893 for deplib in $dependency_libs; do
7894 deplibs="$deplib $deplibs"
7895 if $opt_preserve_dup_deps; then
7896 case "$tmp_libs " in
7897 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7898 esac
7899 fi
7900 func_append tmp_libs " $deplib"
7901 done
79028003 continue
79038004 fi # $pass = conv
79048005
88218922 age=$number_minor
88228923 revision=$number_minor
88238924 lt_irix_increment=no
8925 ;;
8926 *)
8927 func_fatal_configuration "$modename: unknown library version type '$version_type'"
88248928 ;;
88258929 esac
88268930 ;;
727727 cat <<_LT_EOF >> "$cfgfile"
728728 #! $SHELL
729729 # Generated automatically by $as_me ($PACKAGE) $VERSION
730 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
731730 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
732731
733732 # Provide generalized library-building support services.
10411040 _LT_EOF
10421041 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
10431042 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1044 echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1045 $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1043 echo "$AR cr libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1044 $AR cr libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
10461045 echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
10471046 $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
10481047 cat > conftest.c << _LT_EOF
10661065 _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
10671066 darwin1.*)
10681067 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1069 darwin*)
1070 case ${MACOSX_DEPLOYMENT_TARGET},$host in
1071 10.[[012]],*|,*powerpc*)
1068 darwin*) # darwin 5.x on
1069 # if running on 10.5 or later, the deployment target defaults
1070 # to the OS version, if on x86, and 10.4, the deployment
1071 # target defaults to 10.4. Don't you love it?
1072 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1073 10.0,*86*-darwin8*|10.0,*-darwin[[912]]*)
1074 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1075 10.[[012]][[,.]]*)
10721076 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1073 *)
1077 10.*|11.*)
10741078 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10751079 esac
10761080 ;;
14871491 m4_defun([_LT_PROG_AR],
14881492 [AC_CHECK_TOOLS(AR, [ar], false)
14891493 : ${AR=ar}
1490 : ${AR_FLAGS=cru}
1494 : ${AR_FLAGS=cr}
14911495 _LT_DECL([], [AR], [1], [The archiver])
14921496 _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
14931497
28812885 dynamic_linker='GNU/Linux ld.so'
28822886 ;;
28832887
2888 netbsdelf*-gnu)
2889 version_type=linux
2890 need_lib_prefix=no
2891 need_version=no
2892 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2893 soname_spec='${libname}${release}${shared_ext}$major'
2894 shlibpath_var=LD_LIBRARY_PATH
2895 shlibpath_overrides_runpath=no
2896 hardcode_into_libs=yes
2897 dynamic_linker='NetBSD ld.elf_so'
2898 ;;
2899
28842900 netbsd*)
28852901 version_type=sunos
28862902 need_lib_prefix=no
35403556 lt_cv_deplibs_check_method=pass_all
35413557 ;;
35423558
3543 netbsd*)
3559 netbsd* | netbsdelf*-gnu)
35443560 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
35453561 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
35463562 else
40464062 if AC_TRY_EVAL(ac_compile); then
40474063 # Now try to grab the symbols.
40484064 nlist=conftest.nm
4049 if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4065 $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD
4066 if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then
40504067 # Try sorting and uniquifying the output.
40514068 if sort "$nlist" | uniq > "$nlist"T; then
40524069 mv -f "$nlist"T "$nlist"
44184435 ;;
44194436 esac
44204437 ;;
4421 netbsd*)
4438 netbsd* | netbsdelf*-gnu)
44224439 ;;
44234440 *qnx* | *nto*)
44244441 # QNX uses GNU C++, but need to define -shared option too, otherwise
46864703 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
46874704 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
46884705 ;;
4706 # flang / f18. f95 an alias for gfortran or flang on Debian
4707 flang* | f18* | f95*)
4708 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4709 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4710 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4711 ;;
46894712 # icc used to be incompatible with GCC.
46904713 # ICC 10 doesn't accept -KPIC any more.
46914714 icc* | ifort*)
49304953 ;;
49314954 esac
49324955 ;;
4956 linux* | k*bsd*-gnu | gnu*)
4957 _LT_TAGVAR(link_all_deplibs, $1)=no
4958 ;;
49334959 *)
49344960 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49354961 ;;
49915017 ;;
49925018 openbsd* | bitrig*)
49935019 with_gnu_ld=no
5020 ;;
5021 linux* | k*bsd*-gnu | gnu*)
5022 _LT_TAGVAR(link_all_deplibs, $1)=no
49945023 ;;
49955024 esac
49965025
52465275 fi
52475276 ;;
52485277
5249 netbsd*)
5278 netbsd* | netbsdelf*-gnu)
52505279 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
52515280 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
52525281 wlarc=
57675796 if test yes = "$lt_cv_irix_exported_symbol"; then
57685797 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
57695798 fi
5799 _LT_TAGVAR(link_all_deplibs, $1)=no
57705800 else
57715801 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
57725802 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
57885818 esac
57895819 ;;
57905820
5791 netbsd*)
5821 netbsd* | netbsdelf*-gnu)
57925822 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
57935823 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
57945824 else
64146444 # Commands to make compiler produce verbose output that lists
64156445 # what "hidden" libraries, object files and flags are used when
64166446 # linking a shared library.
6417 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6447 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
64186448
64196449 else
64206450 GXX=no
67896819 # explicitly linking system object files so we need to strip them
67906820 # from the output so that they don't get included in the library
67916821 # dependencies.
6792 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6822 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
67936823 ;;
67946824 *)
67956825 if test yes = "$GXX"; then
68546884 # explicitly linking system object files so we need to strip them
68556885 # from the output so that they don't get included in the library
68566886 # dependencies.
6857 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6887 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
68586888 ;;
68596889 *)
68606890 if test yes = "$GXX"; then
71937223 # Commands to make compiler produce verbose output that lists
71947224 # what "hidden" libraries, object files and flags are used when
71957225 # linking a shared library.
7196 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7226 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
71977227
71987228 else
71997229 # FIXME: insert proper C++ library support
72777307 # Commands to make compiler produce verbose output that lists
72787308 # what "hidden" libraries, object files and flags are used when
72797309 # linking a shared library.
7280 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7310 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
72817311 else
72827312 # g++ 2.7 appears to require '-G' NOT '-shared' on this
72837313 # platform.
72887318 # Commands to make compiler produce verbose output that lists
72897319 # what "hidden" libraries, object files and flags are used when
72907320 # linking a shared library.
7291 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7321 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
72927322 fi
72937323
72947324 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
22
33 scriptversion=2018-03-07.03; # UTC
44
5 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
5 # Copyright (C) 1996-2021 Free Software Foundation, Inc.
66 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
77
88 # This program is free software; you can redistribute it and/or modify
0 # Makefile.in generated by automake 1.16.1 from Makefile.am.
0 # Makefile.in generated by automake 1.16.4 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2021 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
171171 unique=`for i in $$list; do \
172172 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
173173 done | $(am__uniquify_input)`
174 ETAGS = etags
175 CTAGS = ctags
176174 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
177175 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
178176 ACLOCAL = @ACLOCAL@
190188 CFLAGS = @CFLAGS@
191189 CPP = @CPP@
192190 CPPFLAGS = @CPPFLAGS@
191 CSCOPE = @CSCOPE@
192 CTAGS = @CTAGS@
193193 CYGPATH_W = @CYGPATH_W@
194194 DEFS = @DEFS@
195195 DEPDIR = @DEPDIR@
200200 ECHO_N = @ECHO_N@
201201 ECHO_T = @ECHO_T@
202202 EGREP = @EGREP@
203 ETAGS = @ETAGS@
203204 EXEEXT = @EXEEXT@
204205 FGREP = @FGREP@
205206 FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
301302 prefix = @prefix@
302303 program_transform_name = @program_transform_name@
303304 psdir = @psdir@
305 runstatedir = @runstatedir@
304306 sbindir = @sbindir@
305307 sharedstatedir = @sharedstatedir@
306308 srcdir = @srcdir@
467469
468470 distclean-tags:
469471 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
470
471472 distdir: $(BUILT_SOURCES)
472473 $(MAKE) $(AM_MAKEFLAGS) distdir-am
473474
0 # Makefile.in generated by automake 1.16.1 from Makefile.am.
0 # Makefile.in generated by automake 1.16.4 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2021 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
171171 unique=`for i in $$list; do \
172172 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
173173 done | $(am__uniquify_input)`
174 ETAGS = etags
175 CTAGS = ctags
176174 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
177175 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
178176 ACLOCAL = @ACLOCAL@
190188 CFLAGS = @CFLAGS@
191189 CPP = @CPP@
192190 CPPFLAGS = @CPPFLAGS@
191 CSCOPE = @CSCOPE@
192 CTAGS = @CTAGS@
193193 CYGPATH_W = @CYGPATH_W@
194194 DEFS = @DEFS@
195195 DEPDIR = @DEPDIR@
200200 ECHO_N = @ECHO_N@
201201 ECHO_T = @ECHO_T@
202202 EGREP = @EGREP@
203 ETAGS = @ETAGS@
203204 EXEEXT = @EXEEXT@
204205 FGREP = @FGREP@
205206 FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
301302 prefix = @prefix@
302303 program_transform_name = @program_transform_name@
303304 psdir = @psdir@
305 runstatedir = @runstatedir@
304306 sbindir = @sbindir@
305307 sharedstatedir = @sharedstatedir@
306308 srcdir = @srcdir@
467469
468470 distclean-tags:
469471 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
470
471472 distdir: $(BUILT_SOURCES)
472473 $(MAKE) $(AM_MAKEFLAGS) distdir-am
473474