From 4aa9d578556b2b92f0eac946da059c9345c42c3f Mon Sep 17 00:00:00 2001 From: Bruce Miller Date: Sun, 8 Oct 2023 10:17:28 -0400 Subject: [PATCH 1/2] Initial support for Vietnamese --- MANIFEST | 1 + lib/LaTeXML/Package/t5enc.def.ltxml | 41 +++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 lib/LaTeXML/Package/t5enc.def.ltxml diff --git a/MANIFEST b/MANIFEST index b41681e94..ae9ec9413 100644 --- a/MANIFEST +++ b/MANIFEST @@ -707,6 +707,7 @@ lib/LaTeXML/Package/t1enc.sty.ltxml lib/LaTeXML/Package/t2a.fontmap.ltxml lib/LaTeXML/Package/t2b.fontmap.ltxml lib/LaTeXML/Package/t2c.fontmap.ltxml +lib/LaTeXML/Package/t5enc.def.ltxml lib/LaTeXML/Package/tablefootnote.sty.ltxml lib/LaTeXML/Package/tabularx.sty.ltxml lib/LaTeXML/Package/tabulary.sty.ltxml diff --git a/lib/LaTeXML/Package/t5enc.def.ltxml b/lib/LaTeXML/Package/t5enc.def.ltxml new file mode 100644 index 000000000..c36c25d54 --- /dev/null +++ b/lib/LaTeXML/Package/t5enc.def.ltxml @@ -0,0 +1,41 @@ +# -*- mode: Perl -*- +# /=====================================================================\ # +# | t5enc.def | # +# | Implementation for LaTeXML | # +# |=====================================================================| # +# | Part of LaTeXML: | # +# | Public domain software, produced as part of work done by the | # +# | United States Government & not subject to copyright in the US. | # +# |---------------------------------------------------------------------| # +# | Bruce Miller #_# | # +# | http://dlmf.nist.gov/LaTeXML/ (o o) | # +# \=========================================================ooo==U==ooo=/ # +package LaTeXML::Package::Pool; +use strict; +use warnings; +use LaTeXML::Package; + +#********************************************************************** +# vietnamese uses a lot of multiple-accents. +# We probably can get away w/o defininng the whole T5 font map, +# providing we have definintions for the following special cases. +DefAccent('\texthookabove', "\x{0309}", "'"); +Let('\h', '\texthookabove'); +DefPrimitiveI('\Acircumflex', undef, UTF(0xC2)); +DefPrimitiveI('\Abreve', undef, "\x{0102}"); +DefPrimitiveI('\Ecircumflex', undef, UTF(0xCA)); +DefPrimitiveI('\Ocircumflex', undef, UTF(0xD4)); +DefPrimitiveI('\Ohorn', undef, "\x{01A0}"); +DefPrimitiveI('\Uhorn', undef, "\x{01AF}"); +DefPrimitiveI('\acircumflex', undef, UTF(0xE2)); +DefPrimitiveI('\abreve', undef, "\x{0103}"); +DefPrimitiveI('\ecircumflex', undef, UTF(0xEA)); +DefPrimitiveI('\ocircumflex', undef, UTF(0xF4)); +DefPrimitiveI('\ohorn', undef, "\x{01A1}"); +DefPrimitiveI('\uhorn', undef, "\x{01B0}"); +DefAccent('\k', "\x{0328}", "\x{02DB}"); +# Now read the rest from the REAL t5enc. +InputDefinitions('t5enc', type => 'def', noltxml => 1); +#********************************************************************** + +1; From cfd3ea974e21f09f9c2412b9d3fd8e768a140dcc Mon Sep 17 00:00:00 2001 From: Bruce Miller Date: Mon, 9 Oct 2023 13:28:45 -0400 Subject: [PATCH 2/2] Leave a clue when an encoding may not be handled --- lib/LaTeXML/Package.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/LaTeXML/Package.pm b/lib/LaTeXML/Package.pm index 9f8b16574..8ea5c2956 100644 --- a/lib/LaTeXML/Package.pm +++ b/lib/LaTeXML/Package.pm @@ -2793,6 +2793,7 @@ sub LoadFontMap { if ($map = LookupValue($encoding . '_fontmap')) { # Got map? AssignValue($encoding . '_fontmap_failed_to_load' => 0); } else { + Info('fontmap', $encoding, undef, "Couldn't find fontmap for '$encoding'"); AssignValue($encoding . '_fontmap_failed_to_load' => 1, 'global'); } } return $map; }