add afdko

for conversion of Type 1 fonts to OTF, see:
https://github.com/adobe-type-tools/afdko

Requires antlr4-cpp-runtime, see:
https://github.com/antlr

Change-Id: Id5845e8f62d09055e140fd987dc2545c7fc0c48d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191202
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 3d13970f18c6c578a6edd8f9669874ff96ae0143)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192332
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara
2025-10-14 17:13:19 +02:00
parent a07f02a68d
commit 4297095d67
17 changed files with 947 additions and 0 deletions
+2
View File
@@ -101,6 +101,8 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S
@date >> $(fetch_LOGFILE)
$(foreach item, \
$(call fetch_Optional,ABW,ABW_TARBALL) \
$(call fetch_Optional,AFDKO,AFDKO_TARBALL) \
$(call fetch_Optional,AFDKO,ANTLR4CPPRUNTIME_TARBALL) \
$(call fetch_Optional,ARGON2,ARGON2_TARBALL) \
$(call fetch_Optional,BOOST,BOOST_TARBALL) \
$(call fetch_Optional,BOX2D,BOX2D_TARBALL) \
+21
View File
@@ -4276,6 +4276,27 @@ endef
$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo,\
pdfium \
))
define gb_LinkTarget__use_afdko
$(call gb_LinkTarget_use_unpacked,$(1),afdko)
$(call gb_LinkTarget_set_include,$(1),\
-I$(gb_UnpackedTarball_workdir)/afdko/c/shared/include \
-I$(gb_UnpackedTarball_workdir)/afdko/c/shared/resource \
-I$(gb_UnpackedTarball_workdir)/afdko/c/makeotf/include \
-I$(gb_UnpackedTarball_workdir)/afdko/c/makeotf/source \
$$(INCLUDE) \
)
$(call gb_LinkTarget_use_static_libraries,$(1),\
afdko \
)
endef
define gb_ExternalProject__use_afdko
$(call gb_ExternalProject_use_static_libraries,$(1),afdko)
endef
endif
ifneq ($(SYSTEM_DRAGONBOX),)
+6
View File
@@ -12961,6 +12961,12 @@ if test "$ENABLE_PDFIUM" = "TRUE"; then
else
AC_MSG_RESULT([internal])
fi
# Only used by the pdf import code that uses pdfium
# which doesn't currently have --with-system support
if test "$ENABLE_PDFIMPORT" = "TRUE"; then
BUILD_TYPE="$BUILD_TYPE AFDKO"
fi
fi
AC_SUBST(SYSTEM_OPENJPEG2)
AC_SUBST(SYSTEM_ABSEIL)
+10
View File
@@ -569,6 +569,16 @@ PDFIUM_TARBALL := pdfium-7188.tar.bz2
# three static lines
# so that git cherry-pick
# will not run into conflicts
AFDKO_SHA256SUM := e1a31e871e83dd022635b852297c433c8e9c9d9d4f0c0f634e8d55dde28ad930
AFDKO_TARBALL := afdko-4.0.2.tar.gz
# three static lines
# so that git cherry-pick
# will not run into conflicts
ANTLR4CPPRUNTIME_SHA256SUM := 0ed13668906e86dbc0dcddf30fdee68c10203dea4e83852b4edb810821bee3c4
ANTLR4CPPRUNTIME_TARBALL := antlr4-cpp-runtime-4.13.2-source.zip
# three static lines
# so that git cherry-pick
# will not run into conflicts
PIXMAN_SHA256SUM := a098c33924754ad43f981b740f6d576c70f9ed1006e12221b1845431ebce1239
PIXMAN_TARBALL := pixman-0.46.4.tar.xz
# three static lines
+1
View File
@@ -12,6 +12,7 @@ $(eval $(call gb_Module_Module,external))
$(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,XMLSEC,xmlsec) \
$(call gb_Helper_optional,ABW,libabw) \
$(call gb_Helper_optional,AFDKO,afdko) \
$(call gb_Helper_optional,ARGON2,argon2) \
$(call gb_Helper_optional,BOOST,boost) \
$(call gb_Helper_optional,BOX2D,box2d) \
+7
View File
@@ -0,0 +1,7 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
include $(module_directory)/../../solenv/gbuild/partial_build.mk
# vim: set noet sw=4 ts=4:
+17
View File
@@ -0,0 +1,17 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Module_Module,afdko))
$(eval $(call gb_Module_add_targets,afdko,\
StaticLibrary_afdko \
UnpackedTarball_afdko \
))
# vim: set noet sw=4 ts=4:
+3
View File
@@ -0,0 +1,3 @@
External package containing afdko from [https://github.com/adobe-type-tools/afdko].
This is used to convert and merge Type 1 fonts to otf.
+280
View File
@@ -0,0 +1,280 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_StaticLibrary_StaticLibrary,afdko))
$(eval $(call gb_StaticLibrary_use_unpacked,afdko,afdko))
$(eval $(call gb_StaticLibrary_set_warnings_disabled,afdko))
$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,afdko,cpp))
$(eval $(call gb_StaticLibrary_set_include,afdko,\
-I$(gb_UnpackedTarball_workdir)/afdko/c/shared/include \
-I$(gb_UnpackedTarball_workdir)/afdko/c/shared/resource \
-I$(gb_UnpackedTarball_workdir)/afdko/c/shared/source/tx_shared \
-I$(gb_UnpackedTarball_workdir)/afdko/c/makeotf \
-I$(gb_UnpackedTarball_workdir)/afdko/a4/runtime/src \
$$(INCLUDE) \
))
$(eval $(call gb_StaticLibrary_use_externals,afdko,\
libxml2 \
))
$(eval $(call gb_StaticLibrary_add_defs,afdko, \
-DTC_EURO_SUPPORT=1 \
-DTC_SUBR_SUPPORT=1 \
-DTC_HINT_CHECK=1 \
-DANTLR4CPP_STATIC \
))
$(eval $(call gb_StaticLibrary_add_generated_cobjects,afdko,\
UnpackedTarball/afdko/c/shared/source/absfont/absfont \
UnpackedTarball/afdko/c/shared/source/absfont/absfont_afm \
UnpackedTarball/afdko/c/shared/source/absfont/absfont_compare \
UnpackedTarball/afdko/c/shared/source/absfont/absfont_desc \
UnpackedTarball/afdko/c/shared/source/absfont/absfont_draw \
UnpackedTarball/afdko/c/shared/source/absfont/absfont_dump \
UnpackedTarball/afdko/c/shared/source/absfont/absfont_metrics \
UnpackedTarball/afdko/c/shared/source/absfont/absfont_path \
UnpackedTarball/afdko/c/shared/source/cfembed/cfembed \
UnpackedTarball/afdko/c/shared/source/cffread/cffread \
UnpackedTarball/afdko/c/shared/source/cffwrite/cffwrite \
UnpackedTarball/afdko/c/shared/source/cffwrite/cffwrite_charset \
UnpackedTarball/afdko/c/shared/source/cffwrite/cffwrite_dict \
UnpackedTarball/afdko/c/shared/source/cffwrite/cffwrite_encoding \
UnpackedTarball/afdko/c/shared/source/cffwrite/cffwrite_fdselect \
UnpackedTarball/afdko/c/shared/source/cffwrite/cffwrite_sindex \
UnpackedTarball/afdko/c/shared/source/cffwrite/cffwrite_subr \
UnpackedTarball/afdko/c/shared/source/cffwrite/cffwrite_t2cstr \
UnpackedTarball/afdko/c/shared/source/cffwrite/cffwrite_varstore \
UnpackedTarball/afdko/c/shared/source/ctutil/ctutil \
UnpackedTarball/afdko/c/shared/source/dynarr/dynarr \
UnpackedTarball/afdko/c/shared/source/nameread/nameread \
UnpackedTarball/afdko/c/shared/source/pdfwrite/pdfwrite \
UnpackedTarball/afdko/c/shared/source/pstoken/pstoken \
UnpackedTarball/afdko/c/shared/source/sfntread/sfntread \
UnpackedTarball/afdko/c/shared/source/sfntwrite/sfntwrite \
UnpackedTarball/afdko/c/shared/source/sha1/sha1 \
UnpackedTarball/afdko/c/shared/source/support/canthappen \
UnpackedTarball/afdko/c/shared/source/support/except \
UnpackedTarball/afdko/c/shared/source/support/fixed \
UnpackedTarball/afdko/c/shared/source/svgwrite/svgwrite \
UnpackedTarball/afdko/c/shared/source/svread/svread \
UnpackedTarball/afdko/c/shared/source/t1cstr/t1cstr \
UnpackedTarball/afdko/c/shared/source/t1read/t1read \
UnpackedTarball/afdko/c/shared/source/t1write/t1write \
UnpackedTarball/afdko/c/shared/source/t2cstr/t2cstr \
UnpackedTarball/afdko/c/shared/source/ttread/ttread \
UnpackedTarball/afdko/c/shared/source/varread/varread \
UnpackedTarball/afdko/c/shared/source/uforead/uforead \
UnpackedTarball/afdko/c/shared/source/ufowrite/ufowrite \
UnpackedTarball/afdko/c/shared/source/tx_shared/tx_shared \
))
$(eval $(call gb_StaticLibrary_add_generated_cobjects,afdko,\
UnpackedTarball/afdko/c/tx/source/tx \
))
$(eval $(call gb_StaticLibrary_add_generated_cobjects,afdko,\
UnpackedTarball/afdko/c/mergefonts/source/mergeFonts \
))
$(eval $(call gb_StaticLibrary_add_generated_cobjects,afdko,\
UnpackedTarball/afdko/c/makeotf/source/c_main \
UnpackedTarball/afdko/c/makeotf/source/cb \
UnpackedTarball/afdko/c/makeotf/source/cbpriv \
UnpackedTarball/afdko/c/makeotf/source/fcdb \
UnpackedTarball/afdko/c/makeotf/source/file \
UnpackedTarball/afdko/c/makeotf/source/mac \
UnpackedTarball/afdko/c/makeotf/lib/cffread/cffread \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/BASE \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/CFF_ \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/GDEF \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/GPOS \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/GSUB \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/OS_2 \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/STAT \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/VORG \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/anon \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/cmap \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/head \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/hhea \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/hmtx \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/hot \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/map \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/maxp \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/name \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/otl \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/post \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/sfnt \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/vhea \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/vmtx \
UnpackedTarball/afdko/c/makeotf/lib/pstoken/pstoken \
UnpackedTarball/afdko/c/makeotf/lib/typecomp/charset \
UnpackedTarball/afdko/c/makeotf/lib/typecomp/cs \
UnpackedTarball/afdko/c/makeotf/lib/typecomp/dict \
UnpackedTarball/afdko/c/makeotf/lib/typecomp/encoding \
UnpackedTarball/afdko/c/makeotf/lib/typecomp/fdselect \
UnpackedTarball/afdko/c/makeotf/lib/typecomp/parse \
UnpackedTarball/afdko/c/makeotf/lib/typecomp/recode \
UnpackedTarball/afdko/c/makeotf/lib/typecomp/sindex \
UnpackedTarball/afdko/c/makeotf/lib/typecomp/subr \
UnpackedTarball/afdko/c/makeotf/lib/typecomp/t13 \
UnpackedTarball/afdko/c/makeotf/lib/typecomp/tc \
))
$(eval $(call gb_StaticLibrary_add_generated_exception_objects,afdko,\
UnpackedTarball/afdko/c/makeotf/lib/hotconv/FeatCtx \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/FeatLexer \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/FeatParser \
UnpackedTarball/afdko/c/makeotf/lib/hotconv/FeatVisitor \
))
$(eval $(call gb_StaticLibrary_add_generated_exception_objects,afdko,\
UnpackedTarball/afdko/a4/runtime/src/ANTLRErrorListener \
UnpackedTarball/afdko/a4/runtime/src/ANTLRErrorStrategy \
UnpackedTarball/afdko/a4/runtime/src/ANTLRFileStream \
UnpackedTarball/afdko/a4/runtime/src/ANTLRInputStream \
UnpackedTarball/afdko/a4/runtime/src/BailErrorStrategy \
UnpackedTarball/afdko/a4/runtime/src/BaseErrorListener \
UnpackedTarball/afdko/a4/runtime/src/BufferedTokenStream \
UnpackedTarball/afdko/a4/runtime/src/CharStream \
UnpackedTarball/afdko/a4/runtime/src/CommonToken \
UnpackedTarball/afdko/a4/runtime/src/CommonTokenFactory \
UnpackedTarball/afdko/a4/runtime/src/CommonTokenStream \
UnpackedTarball/afdko/a4/runtime/src/ConsoleErrorListener \
UnpackedTarball/afdko/a4/runtime/src/DefaultErrorStrategy \
UnpackedTarball/afdko/a4/runtime/src/DiagnosticErrorListener \
UnpackedTarball/afdko/a4/runtime/src/Exceptions \
UnpackedTarball/afdko/a4/runtime/src/FailedPredicateException \
UnpackedTarball/afdko/a4/runtime/src/InputMismatchException \
UnpackedTarball/afdko/a4/runtime/src/InterpreterRuleContext \
UnpackedTarball/afdko/a4/runtime/src/IntStream \
UnpackedTarball/afdko/a4/runtime/src/Lexer \
UnpackedTarball/afdko/a4/runtime/src/LexerInterpreter \
UnpackedTarball/afdko/a4/runtime/src/LexerNoViableAltException \
UnpackedTarball/afdko/a4/runtime/src/ListTokenSource \
UnpackedTarball/afdko/a4/runtime/src/NoViableAltException \
UnpackedTarball/afdko/a4/runtime/src/Parser \
UnpackedTarball/afdko/a4/runtime/src/ParserInterpreter \
UnpackedTarball/afdko/a4/runtime/src/ParserRuleContext \
UnpackedTarball/afdko/a4/runtime/src/ProxyErrorListener \
UnpackedTarball/afdko/a4/runtime/src/RecognitionException \
UnpackedTarball/afdko/a4/runtime/src/Recognizer \
UnpackedTarball/afdko/a4/runtime/src/RuleContext \
UnpackedTarball/afdko/a4/runtime/src/RuleContextWithAltNum \
UnpackedTarball/afdko/a4/runtime/src/RuntimeMetaData \
UnpackedTarball/afdko/a4/runtime/src/Token \
UnpackedTarball/afdko/a4/runtime/src/TokenSource \
UnpackedTarball/afdko/a4/runtime/src/TokenStream \
UnpackedTarball/afdko/a4/runtime/src/TokenStreamRewriter \
UnpackedTarball/afdko/a4/runtime/src/UnbufferedCharStream \
UnpackedTarball/afdko/a4/runtime/src/UnbufferedTokenStream \
UnpackedTarball/afdko/a4/runtime/src/Vocabulary \
UnpackedTarball/afdko/a4/runtime/src/WritableToken \
UnpackedTarball/afdko/a4/runtime/src/atn/ActionTransition \
UnpackedTarball/afdko/a4/runtime/src/atn/AmbiguityInfo \
UnpackedTarball/afdko/a4/runtime/src/atn/ArrayPredictionContext \
UnpackedTarball/afdko/a4/runtime/src/atn/ATNConfig \
UnpackedTarball/afdko/a4/runtime/src/atn/ATNConfigSet \
UnpackedTarball/afdko/a4/runtime/src/atn/ATN \
UnpackedTarball/afdko/a4/runtime/src/atn/ATNDeserializationOptions \
UnpackedTarball/afdko/a4/runtime/src/atn/ATNDeserializer \
UnpackedTarball/afdko/a4/runtime/src/atn/ATNSimulator \
UnpackedTarball/afdko/a4/runtime/src/atn/ATNState \
UnpackedTarball/afdko/a4/runtime/src/atn/ATNStateType \
UnpackedTarball/afdko/a4/runtime/src/atn/AtomTransition \
UnpackedTarball/afdko/a4/runtime/src/atn/ContextSensitivityInfo \
UnpackedTarball/afdko/a4/runtime/src/atn/DecisionEventInfo \
UnpackedTarball/afdko/a4/runtime/src/atn/DecisionInfo \
UnpackedTarball/afdko/a4/runtime/src/atn/DecisionState \
UnpackedTarball/afdko/a4/runtime/src/atn/EpsilonTransition \
UnpackedTarball/afdko/a4/runtime/src/atn/ErrorInfo \
UnpackedTarball/afdko/a4/runtime/src/atn/LexerAction \
UnpackedTarball/afdko/a4/runtime/src/atn/LexerActionExecutor \
UnpackedTarball/afdko/a4/runtime/src/atn/LexerATNConfig \
UnpackedTarball/afdko/a4/runtime/src/atn/LexerATNSimulator \
UnpackedTarball/afdko/a4/runtime/src/atn/LexerChannelAction \
UnpackedTarball/afdko/a4/runtime/src/atn/LexerCustomAction \
UnpackedTarball/afdko/a4/runtime/src/atn/LexerIndexedCustomAction \
UnpackedTarball/afdko/a4/runtime/src/atn/LexerModeAction \
UnpackedTarball/afdko/a4/runtime/src/atn/LexerMoreAction \
UnpackedTarball/afdko/a4/runtime/src/atn/LexerPopModeAction \
UnpackedTarball/afdko/a4/runtime/src/atn/LexerPushModeAction \
UnpackedTarball/afdko/a4/runtime/src/atn/LexerSkipAction \
UnpackedTarball/afdko/a4/runtime/src/atn/LexerTypeAction \
UnpackedTarball/afdko/a4/runtime/src/atn/LL1Analyzer \
UnpackedTarball/afdko/a4/runtime/src/atn/LookaheadEventInfo \
UnpackedTarball/afdko/a4/runtime/src/atn/NotSetTransition \
UnpackedTarball/afdko/a4/runtime/src/atn/OrderedATNConfigSet \
UnpackedTarball/afdko/a4/runtime/src/atn/ParseInfo \
UnpackedTarball/afdko/a4/runtime/src/atn/ParserATNSimulator \
UnpackedTarball/afdko/a4/runtime/src/atn/PrecedencePredicateTransition \
UnpackedTarball/afdko/a4/runtime/src/atn/PredicateEvalInfo \
UnpackedTarball/afdko/a4/runtime/src/atn/PredicateTransition \
UnpackedTarball/afdko/a4/runtime/src/atn/PredictionContextCache \
UnpackedTarball/afdko/a4/runtime/src/atn/PredictionContext \
UnpackedTarball/afdko/a4/runtime/src/atn/PredictionContextMergeCache \
UnpackedTarball/afdko/a4/runtime/src/atn/PredictionMode \
UnpackedTarball/afdko/a4/runtime/src/atn/ProfilingATNSimulator \
UnpackedTarball/afdko/a4/runtime/src/atn/RangeTransition \
UnpackedTarball/afdko/a4/runtime/src/atn/RuleTransition \
UnpackedTarball/afdko/a4/runtime/src/atn/SemanticContext \
UnpackedTarball/afdko/a4/runtime/src/atn/SetTransition \
UnpackedTarball/afdko/a4/runtime/src/atn/SingletonPredictionContext \
UnpackedTarball/afdko/a4/runtime/src/atn/StarLoopbackState \
UnpackedTarball/afdko/a4/runtime/src/atn/Transition \
UnpackedTarball/afdko/a4/runtime/src/atn/TransitionType \
UnpackedTarball/afdko/a4/runtime/src/atn/WildcardTransition \
UnpackedTarball/afdko/a4/runtime/src/dfa/DFA \
UnpackedTarball/afdko/a4/runtime/src/dfa/DFASerializer \
UnpackedTarball/afdko/a4/runtime/src/dfa/DFAState \
UnpackedTarball/afdko/a4/runtime/src/dfa/LexerDFASerializer \
UnpackedTarball/afdko/a4/runtime/src/internal/Synchronization \
UnpackedTarball/afdko/a4/runtime/src/misc/InterpreterDataReader \
UnpackedTarball/afdko/a4/runtime/src/misc/Interval \
UnpackedTarball/afdko/a4/runtime/src/misc/IntervalSet \
UnpackedTarball/afdko/a4/runtime/src/misc/MurmurHash \
UnpackedTarball/afdko/a4/runtime/src/misc/Predicate \
UnpackedTarball/afdko/a4/runtime/src/support/Any \
UnpackedTarball/afdko/a4/runtime/src/support/Arrays \
UnpackedTarball/afdko/a4/runtime/src/support/CPPUtils \
UnpackedTarball/afdko/a4/runtime/src/support/StringUtils \
UnpackedTarball/afdko/a4/runtime/src/support/Utf8 \
UnpackedTarball/afdko/a4/runtime/src/tree/ErrorNodeImpl \
UnpackedTarball/afdko/a4/runtime/src/tree/IterativeParseTreeWalker \
UnpackedTarball/afdko/a4/runtime/src/tree/ParseTree \
UnpackedTarball/afdko/a4/runtime/src/tree/ParseTreeListener \
UnpackedTarball/afdko/a4/runtime/src/tree/ParseTreeVisitor \
UnpackedTarball/afdko/a4/runtime/src/tree/ParseTreeWalker \
UnpackedTarball/afdko/a4/runtime/src/tree/TerminalNodeImpl \
UnpackedTarball/afdko/a4/runtime/src/tree/Trees \
UnpackedTarball/afdko/a4/runtime/src/tree/pattern/Chunk \
UnpackedTarball/afdko/a4/runtime/src/tree/pattern/ParseTreeMatch \
UnpackedTarball/afdko/a4/runtime/src/tree/pattern/ParseTreePattern \
UnpackedTarball/afdko/a4/runtime/src/tree/pattern/ParseTreePatternMatcher \
UnpackedTarball/afdko/a4/runtime/src/tree/pattern/RuleTagToken \
UnpackedTarball/afdko/a4/runtime/src/tree/pattern/TagChunk \
UnpackedTarball/afdko/a4/runtime/src/tree/pattern/TextChunk \
UnpackedTarball/afdko/a4/runtime/src/tree/pattern/TokenTagToken \
UnpackedTarball/afdko/a4/runtime/src/tree/xpath/XPath \
UnpackedTarball/afdko/a4/runtime/src/tree/xpath/XPathElement \
UnpackedTarball/afdko/a4/runtime/src/tree/xpath/XPathLexer \
UnpackedTarball/afdko/a4/runtime/src/tree/xpath/XPathLexerErrorListener \
UnpackedTarball/afdko/a4/runtime/src/tree/xpath/XPathRuleAnywhereElement \
UnpackedTarball/afdko/a4/runtime/src/tree/xpath/XPathRuleElement \
UnpackedTarball/afdko/a4/runtime/src/tree/xpath/XPathTokenAnywhereElement \
UnpackedTarball/afdko/a4/runtime/src/tree/xpath/XPathTokenElement \
UnpackedTarball/afdko/a4/runtime/src/tree/xpath/XPathWildcardAnywhereElement \
UnpackedTarball/afdko/a4/runtime/src/tree/xpath/XPathWildcardElement \
))
# vim: set noet sw=4 ts=4:
+28
View File
@@ -0,0 +1,28 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_UnpackedTarball_UnpackedTarball,afdko))
$(eval $(call gb_UnpackedTarball_set_tarball,afdko,$(AFDKO_TARBALL)))
$(eval $(call gb_UnpackedTarball_set_pre_action,afdko,\
unzip -q -d a4 -o $(gb_UnpackedTarget_TARFILE_LOCATION)/$(ANTLR4CPPRUNTIME_TARBALL) \
))
$(eval $(call gb_UnpackedTarball_set_patchlevel,afdko,1))
$(eval $(call gb_UnpackedTarball_add_patches,afdko, \
external/afdko/extern_tx.patch \
external/afdko/extern_mergefonts.patch \
external/afdko/extern_makeotf.patch \
external/afdko/warnings.patch \
external/afdko/antlr4-chrono.patch \
))
# vim: set noet sw=4 ts=4:
+11
View File
@@ -0,0 +1,11 @@
--- afdko/a4/runtime/src/atn/ProfilingATNSimulator.cpp
+++ afdko/a4/runtime/src/atn/ProfilingATNSimulator.cpp
@@ -11,6 +11,8 @@
#include "atn/ProfilingATNSimulator.h"
+#include <chrono>
+
using namespace antlr4;
using namespace antlr4::atn;
using namespace antlr4::dfa;
+302
View File
@@ -0,0 +1,302 @@
--- afdko/c/makeotf/source/c_main.c
+++ afdko/c/makeotf/source/c_main.c
@@ -269,6 +269,7 @@
exit(0);
}
+#if 0
extern char *sep();
/* Copy directory path with overflow checking */
@@ -744,6 +745,7 @@
convert.fontDone = 1;
}
+#endif
/*Used to parse the parameter string passed in by python
* start is the start index and is updated to the beginning of the next substring
@@ -822,6 +824,7 @@
}
}
+#if 0
/* Main program */
int c_main(int argc, char *argv[]) {
dnaCtx mainDnaCtx = NULL;
@@ -874,3 +877,4 @@
return 0;
}
+#endif
--- afdko/c/makeotf/source/cb.c 2025-09-23 13:18:57.919265608 +0100
+++ afdko/c/makeotf/source/cb.c 2025-09-23 13:20:13.039352315 +0100
@@ -267,14 +267,14 @@
/* Full block */
*count = fileReadN(&h->ps.file, BUFSIZ, h->ps.buf);
if (*count != BUFSIZ) {
- fileError(&h->ps.file);
+ fileHandleError(&h->ps.file);
}
h->ps.left -= BUFSIZ;
} else if (h->ps.left > 0) {
/* Partial block */
*count = fileReadN(&h->ps.file, h->ps.left, h->ps.buf);
if (*count != h->ps.left) {
- fileError(&h->ps.file);
+ fileHandleError(&h->ps.file);
}
h->ps.left = 0;
} else {
@@ -531,7 +531,7 @@
cbCtx h = ctx;
h->tmp.file.name = "tmpfile";
if ((h->tmp.file.fp = tmpfile()) == NULL) {
- fileError(&h->tmp.file);
+ fileHandleError(&h->tmp.file);
}
}
@@ -636,7 +636,7 @@
File *file = &h->fcdb.files.array[fileid];
fileSeek(file, offset, SEEK_SET);
if (fileReadN(file, length, buf) != length)
- fileError(file);
+ fileHandleError(file);
}
// [fcdb callback] Report database parsing warning.
--- afdko/c/makeotf/source/file.c 2025-09-23 13:18:57.919265608 +0100
+++ afdko/c/makeotf/source/file.c 2025-09-23 13:20:04.148358137 +0100
@@ -23,7 +23,7 @@
#endif /* SUNOS */
/* Print file error message and quit */
-void fileError(File *f) {
+void fileHandleError(File *f) {
cbFatal(f->h, "file error <%s> [%s]", strerror(errno), f->name);
}
@@ -33,7 +33,7 @@
f->name = filename;
f->fp = fopen(filename, mode);
if (f->fp == NULL) {
- fileError(f);
+ fileHandleError(f);
}
}
@@ -52,7 +52,7 @@
int fileReadN(File *f, size_t count, void *ptr) {
size_t n = fread(ptr, 1, count, f->fp);
if (n == 0 && ferror(f->fp)) {
- fileError(f);
+ fileHandleError(f);
}
return n;
}
@@ -61,7 +61,7 @@
int fileWriteN(File *f, size_t count, void *ptr) {
size_t n = fwrite(ptr, 1, count, f->fp);
if (n != count) {
- fileError(f);
+ fileHandleError(f);
}
return n;
}
@@ -88,7 +88,7 @@
/* Seek on file */
void fileSeek(File *f, long offset, int wherefrom) {
if (fseek(f->fp, offset, wherefrom) != 0) {
- fileError(f);
+ fileHandleError(f);
}
}
@@ -96,7 +96,7 @@
long fileTell(File *f) {
long posn = ftell(f->fp);
if (posn == -1) {
- fileError(f);
+ fileHandleError(f);
}
return posn;
}
@@ -104,7 +104,7 @@
/* Check for errors and close file */
void fileClose(File *f) {
if (ferror(f->fp)) {
- fileError(f);
+ fileHandleError(f);
}
fclose(f->fp);
}
--- afdko/c/makeotf/source/file.h 2025-09-23 13:18:57.919265608 +0100
+++ afdko/c/makeotf/source/file.h 2025-09-23 13:20:01.042950337 +0100
@@ -29,6 +29,6 @@
void fileSeek(File *file, long offset, int wherefrom);
long fileTell(File *file);
void fileClose(File *file);
-void fileError(File *file);
+void fileHandleError(File *file);
#endif /* MAKEOTF_FILE_H */
--- afdko/c/makeotf/lib/hotconv/common.h
+++ afdko/c/makeotf/lib/hotconv/common.h
@@ -14,7 +14,7 @@
-#include "hotconv.h"
+#include "../../include/hotconv.h"
#include "dynarr.h"
#include "txops.h"
-#include "cffread.h"
+#include "../../include/cffread.h"
-#include "typecomp.h"
+#include "../../include/typecomp.h"
#include "ctutil.h"
--- afdko/c/makeotf/source/package.h
+++ afdko/c/makeotf/source/package.h
@@ -7,7 +7,7 @@
#define MAKEOTF_PACKAGE_SPECS_H
#define TYPECOMP "typecomp.h"
-#define HOTCONV "hotconv.h"
+#define HOTCONV "../include/hotconv.h"
#define DYNARR "dynarr.h"
#endif /* MAKEOTF_PACKAGE_SPECS_H */
--- afdko/c/makeotf/include/cffread.h
+++ afdko/c/makeotf/include/cffread.h
@@ -144,7 +144,7 @@
to cffFontInfo data structure the function returns. This data structure is
described below. */
-#include "txops.h"
+#include "../resource/txops.h"
typedef unsigned short cffSID; /* String identifier */
typedef short cffFWord; /* Font metric in em-relative units */
--- afdko/c/makeotf/lib/typecomp/common.h
+++ afdko/c/makeotf/lib/typecomp/common.h
@@ -7,7 +7,7 @@
#define COMMON_H
#include "dynarr.h"
-#include "typecomp.h"
+#include "../../include/typecomp.h"
#include "stdint.h"
/* Types */
--- afdko/c/makeotf/lib/typecomp/t13.h
+++ afdko/c/makeotf/lib/typecomp/t13.h
@@ -13,7 +13,7 @@
#include "common.h"
#include "cs.h"
-#include "pstoken.h"
+#include "../../include/pstoken.h"
void t13New(tcCtx g);
void t13Free(tcCtx g);
--- afdko/c/makeotf/lib/hotconv/map.c
+++ afdko/c/makeotf/lib/hotconv/map.c
@@ -21,7 +21,7 @@
#include <stdarg.h>
#include <limits.h>
-#include "pstoken.h"
+#include "../../include/pstoken.h"
#define SET_BIT_ARR(a, b) (a[(b) / 32] |= 1UL << (b) % 32)
#define TEST_BIT_ARR(a, b) (a[(b) / 32] & 1UL << (b) % 32)
--- afdko/c/makeotf/lib/pstoken/pstoken.c
+++ afdko/c/makeotf/lib/pstoken/pstoken.c
@@ -7,7 +7,7 @@
*/
#include <stdint.h>
-#include "pstoken.h"
+#include "../../include/pstoken.h"
#include <stdarg.h>
#include <stdlib.h>
--- afdko/c/makeotf/lib/hotconv/cmap.c
+++ afdko/c/makeotf/lib/hotconv/cmap.c
@@ -8,7 +8,7 @@
#include <stdlib.h>
#include <limits.h>
-#include "hotconv.h"
+#include "../../include/hotconv.h"
#include "cmap.h"
#include "hotmap.h"
#include "feat.h"
--- afdko/c/makeotf/lib/cffread/cffread.c
+++ afdko/c/makeotf/lib/cffread/cffread.c
@@ -11,8 +11,8 @@
#include <limits.h>
#include <math.h>
#include <stdio.h>
-#include "cffread.h"
-#include "dictops.h"
+#include "../../include/cffread.h"
+#include "../../resource/dictops.h"
/* Define to supply Microsoft-specific function calling info, e.g. __cdecl */
#ifndef CDECL
--- afdko/c/makeotf/lib/typecomp/recode.c
+++ afdko/c/makeotf/lib/typecomp/recode.c
@@ -8,7 +8,7 @@
#include "parse.h"
#include "subr.h"
-#include "txops.h"
+#include "../../resource/txops.h"
#include <limits.h>
#include <stdio.h>
@@ -248,7 +248,7 @@
#include <math.h>
-#include "cffread.h"
+#include "../../include/cffread.h"
/* Degrees to radians multiplying constant */
#define DEG_2_RAD (3.141592653589793 / 180)
--- afdko/c/makeotf/lib/typecomp/parse.c
+++ afdko/c/makeotf/lib/typecomp/parse.c
@@ -15,8 +15,8 @@
#include "t13.h"
#include "recode.h"
-#include "txops.h"
-#include "pstoken.h"
+#include "../../resource/txops.h"
+#include "../../include/pstoken.h"
#include <stdarg.h>
#include <stdio.h>
--- afdko/c/makeotf/lib/typecomp/dict.h
+++ afdko/c/makeotf/lib/typecomp/dict.h
@@ -11,7 +11,7 @@
#define DICT_H
#include "common.h"
-#include "dictops.h"
+#include "../../resource/dictops.h"
/* Tokenized dictionary data */
typedef dnaDCL(char, DICT);
--- afdko/c/makeotf/source/cbpriv.c
+++ afdko/c/makeotf/source/cbpriv.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdarg.h>
-#include "hotconv.h"
+#include "../include/hotconv.h"
#include "cb.h"
extern void myfatal(void *ctx);
+107
View File
@@ -0,0 +1,107 @@
--- afdko/c/mergefonts/source/mergeFonts.c 2025-09-23 10:51:19.857082828 +0100
+++ afdko/c/mergefonts/source/mergeFonts.c 2025-09-23 10:51:40.645895437 +0100
@@ -1200,7 +1200,7 @@
}
}
-static void readCIDFontInfo(txCtx h, char *filePath) {
+void readCIDFontInfo(txCtx h, char *filePath) {
int lineno;
FILE *fp;
MergeInfo *mergeInfo = (MergeInfo *)h->appSpecificInfo;
@@ -1677,7 +1677,7 @@
/* Process merging multi-file set. Return index of last used arg. */
/* Currently implemented only for mode_cff */
-static int doMergeFileSet(txCtx h, int argc, char *argv[], int i) {
+int doMergeFileSet(txCtx h, int argc, char *argv[], int i) {
sourceCtx srcCtx;
int fileIndex = 0;
int fileCount = 0;
@@ -2609,10 +2609,34 @@
}
}
+void mergeFontsFree(txCtx h);
+
/* Initialize context. */
-static void txNew(txCtx h, char *progname) {
+txCtx mergeFontsNew(char *progname) {
ctlMemoryCallbacks cb;
- MergeInfo *mergeInfo = (MergeInfo *)h->appSpecificInfo;
+ txCtx h;
+ MergeInfo *mergeInfo;
+
+ /* Allocate program context */
+ h = malloc(sizeof(struct txCtx_));
+ if (h == NULL) {
+ fprintf(stderr, "%s: out of memory\n", progname);
+ return NULL;
+ }
+ memset(h, 0, sizeof(struct txCtx_));
+
+ h->app = APP_MERGEFONTS;
+ h->appSpecificInfo = malloc(sizeof(MergeInfo));
+ if (h == NULL) {
+ fprintf(stderr, "%s: out of memory\n", progname);
+ free(h);
+ return NULL;
+ }
+ memset(h->appSpecificInfo, 0, sizeof(MergeInfo));
+
+ h->appSpecificFree = mergeFontsFree;
+
+ mergeInfo = (MergeInfo *)h->appSpecificInfo;
h->progname = progname;
h->flags = 0;
@@ -2690,10 +2714,12 @@
/* Clear the SEEN_MODE bit after setting the default mode */
h->flags = 0;
+
+ return h;
}
/* Free context. */
-static void txFree(txCtx h) {
+void mergeFontsFree(txCtx h) {
long i;
memFree(h, h->script.buf);
@@ -2770,25 +2796,11 @@
--argc;
++argv;
- /* Allocate program context */
- h = malloc(sizeof(struct txCtx_));
- if (h == NULL) {
- fprintf(stderr, "%s: out of memory\n", progname);
- return EXIT_FAILURE;
- }
- memset(h, 0, sizeof(struct txCtx_));
-
- h->app = APP_MERGEFONTS;
- h->appSpecificInfo = malloc(sizeof(MergeInfo));
+ h = mergeFontsNew(progname);
if (h == NULL) {
fprintf(stderr, "%s: out of memory\n", progname);
exit(1);
}
- memset(h->appSpecificInfo, 0, sizeof(MergeInfo));
-
- h->appSpecificFree = txFree;
-
- txNew(h, progname);
if (argc > 1 && getOptionIndex(argv[argc - 2]) == opt_s) {
/* Option list ends with script option */
@@ -2810,7 +2822,7 @@
fprintf(stderr, "mem_manage() called %ld times in this run.\n",
h->failmem.iCall);
}
- txFree(h);
+ mergeFontsFree(h);
return 0;
}
+85
View File
@@ -0,0 +1,85 @@
--- afdko/c/tx/source/tx.c
+++ afdko/c/tx/source/tx.c
@@ -127,7 +127,7 @@
/* ---------------------------- cffread Library ---------------------------- */
/* Read font with cffread library. */
-static void cfrReadFont(txCtx h, long origin, int ttcIndex) {
+void cfrReadFont(txCtx h, long origin, int ttcIndex) {
float *uv;
if (h->cfr.ctx == NULL) {
h->cfr.ctx = cfrNew(&h->cb.mem, &h->cb.stm, CFR_CHECK_ARGS);
@@ -1403,9 +1403,24 @@
}
}
+void txFree(txCtx h);
+
/* Initialize context. */
-static void txNew(txCtx h, char *progname) {
+txCtx txNew(char *progname) {
ctlMemoryCallbacks cb;
+ txCtx h;
+
+ /* Allocate program context */
+ h = malloc(sizeof(struct txCtx_));
+ if (h == NULL) {
+ fprintf(stderr, "%s: out of memory\n", progname);
+ return NULL;
+ }
+ memset(h, 0, sizeof(struct txCtx_));
+
+ h->app = APP_TX;
+ h->appSpecificInfo = NULL; /* unused in tx.c, used in rotateFont.c & mergeFonts.c */
+ h->appSpecificFree = txFree;
h->progname = progname;
h->flags = 0;
@@ -1480,10 +1495,12 @@
/* Clear the SEEN_MODE bit after setting the default mode */
h->flags = 0;
+
+ return h;
}
/* Free context. */
-static void txFree(txCtx h) {
+void txFree(txCtx h) {
long i;
memFree(h, h->script.buf);
@@ -1539,6 +1556,7 @@
free(h);
}
+#if 0
/* Main program. */
int CTL_CDECL main(int argc, char *argv[]) {
txCtx h;
@@ -1564,19 +1582,11 @@
--argc;
++argv;
- /* Allocate program context */
- h = malloc(sizeof(struct txCtx_));
+ h = txNew(progname);
if (h == NULL) {
fprintf(stderr, "%s: out of memory\n", progname);
return EXIT_FAILURE;
}
- memset(h, 0, sizeof(struct txCtx_));
-
- h->app = APP_TX;
- h->appSpecificInfo = NULL; /* unused in tx.c, used in rotateFont.c & mergeFonts.c */
- h->appSpecificFree = txFree;
-
- txNew(h, progname);
if (argc > 1 && getOptionIndex(argv[argc - 2]) == opt_s) {
/* Option list ends with script option */
@@ -1602,3 +1612,4 @@
return 0;
}
+#endif
+20
View File
@@ -0,0 +1,20 @@
--- afdko/c/shared/include/tx_shared.h
+++ afdko/c/shared/include/tx_shared.h
@@ -35,7 +35,7 @@
#include <stdlib.h>
#include <stdbool.h>
-#if PLAT_MAC
+#ifdef PLAT_MAC
#include <console.h>
#include <file_io.h>
#endif /* PLAT_MAC */
@@ -48,7 +48,7 @@
#include <sys/stat.h>
#include <limits.h>
-#if _WIN32
+#ifdef _WIN32
#include <fcntl.h>
#include <io.h>
#define stat _stat
+33
View File
@@ -52,6 +52,39 @@
<h1 style="text-align: center;"><a id="thirdparty" name="thirdparty">Third Party Code Additional Copyright
Notices and License Terms</a></h1>
<h1><a id="a__Libraries" name="a__Libraries">Libraries</a></h1>
<div class="AFDKO">
<h2>Adobe Font Development Kit for OpenType (AFDKO)</h2>
<p>The following software may be included in this product: Adobe Font Development Kit for OpenType (AFDKO).
Use of any of this software is governed by the terms of the license below:</p>
<p><a href="#a__Apache_License_version_2_0">Jump to Apache License Version 2.0</a></p>
</div>
<div class="ANTLR">
<h2>ANTLR (ANother Tool for Language Recognition)</h2>
<p>Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that
the following conditions are met:</p>
<ol>
<li>Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.</li>
<li>Neither name of copyright holders nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.</li>
</ol>
<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
</div>
<div class="ARGON2">
<h2>Argon2</h2>
<p>The following software may be included in this product: Argon2. Use of any of this software is governed
+14
View File
@@ -116,6 +116,20 @@
"dest": "external/tarballs",
"dest-filename": "@PDFIUM_TARBALL@"
},
{
"url": "https://dev-www.libreoffice.org/src/@AFDKO_TARBALL@",
"sha256": "@AFDKO_SHA256SUM@",
"type": "file",
"dest": "external/tarballs",
"dest-filename": "@AFDKO_TARBALL@"
},
{
"url": "https://dev-www.libreoffice.org/src/@ANTLR4CPPRUNTIME_TARBALL@",
"sha256": "@ANTLR4CPPRUNTIME_SHA256SUM@",
"type": "file",
"dest": "external/tarballs",
"dest-filename": "@ANTLR4CPPRUNTIME_TARBALL@"
},
{
"url": "https://dev-www.libreoffice.org/src/@XMLSEC_TARBALL@",
"sha256": "@XMLSEC_SHA256SUM@",