Skip to content

Commit

Permalink
dvipdfm-x: Support for new Adobe-Japan1-UCS2 CMap
Browse files Browse the repository at this point in the history
git-svn-id: svn://tug.org/texlive/trunk/Build/source@68889 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
h20y6m committed Nov 18, 2023
1 parent ca21f0a commit 250a609
Show file tree
Hide file tree
Showing 6 changed files with 1,118 additions and 16 deletions.
9 changes: 9 additions & 0 deletions texk/dvipdfm-x/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2023-11-18 Yukimasa Morimi <h20y6m@yahoo.co.jp>

* cidtype2.c, unicode.c: Support for new Adobe-Japan1-UCS2 CMap.
Ignore variation selectors, when mapping from CID to Unicode.
Converts CJK Unified Ideographs with variant selectors to
CJK Compatibility Ideographs, if possible.
https://github.com/texjporg/tex-jp-build/issues/155
* configure.ac: version 20231118.

2023-08-11 TANAKA Takuji <ttk@t-lab.opal.ne.jp>

* dpxfile.c: Avoid compiler warning on MinGW.
Expand Down
68 changes: 64 additions & 4 deletions texk/dvipdfm-x/cidtype2.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,18 +463,78 @@ cid_to_code (CMap *cmap, CID cid, int unicode_cmap)
else if (outbytesleft == 28) {
if (unicode_cmap) {
/* We assume the output encoding is UTF-16. */
int32_t uc;
int32_t uc, uvs;
const unsigned char *endptr;

p = outbuf;
endptr = p + 4;
uc = UC_UTF16BE_decode_char(&p, endptr);
if (p != endptr)
WARN("CID=%u mapped to non-single Unicode characters...", cid);
return p == endptr ? uc : -1;
if (p == endptr)
return uc; /* single Unicode characters */
/* Check following Variation Selectors */
uvs = UC_UTF16BE_decode_char(&p, endptr);
if (p == endptr && uvs >= 0xfe00 && uvs <= 0xfe0f) {
/* Combine CJK compatibility ideograph */
int32_t cci = UC_Combine_CJK_compatibility_ideograph(uc, uvs);
if (cci > 0)
return cci;
/* Ignore Standardized Variation Sequence */
WARN("Ignored Variation Selector: CID=%u mapped to U+%04X U+%04X", cid, uc, uvs);
return uc;
}
WARN("CID=%u mapped to non-single Unicode characters...", cid);
return -1;
} else {
return (outbuf[0] << 24)|(outbuf[1] << 16)|(outbuf[2] << 8)|outbuf[3];
}
} else if (outbytesleft == 26) { /* 6 bytes sequence */
if (unicode_cmap) {
/* We assume the output encoding is UTF-16. */
int32_t uc, uvs;
const unsigned char *endptr;

p = outbuf;
endptr = p + 6;
uc = UC_UTF16BE_decode_char(&p, endptr);
uvs = UC_UTF16BE_decode_char(&p, endptr);
if (p == endptr) {
if (uvs >= 0xfe00 && uvs <= 0xfe0f) {
/* Combine CJK compatibility ideograph */
int32_t cci = UC_Combine_CJK_compatibility_ideograph(uc, uvs);
if (cci > 0)
return cci;
/* Ignore Standardized Variation Sequence */
WARN("Ignored Variation Selector: CID=%u mapped to U+%04X U+%04X", cid, uc, uvs);
return uc;
} else if (uvs >= 0xe0100 && uvs <= 0xe01ef) {
/* Ignore Ideographic Variation Sequence */
WARN("Ignored Variation Selector: CID=%u mapped to U+%04X U+%04X", cid, uc, uvs);
return uc;
}
}
WARN("CID=%u mapped to non-single Unicode characters...", cid);
return -1;
}
} else if (outbytesleft == 24) { /* 8 bytes sequence */
if (unicode_cmap) {
/* We assume the output encoding is UTF-16. */
int32_t uc, uvs;
const unsigned char *endptr;

p = outbuf;
endptr = p + 8;
uc = UC_UTF16BE_decode_char(&p, endptr);
uvs = UC_UTF16BE_decode_char(&p, endptr);
if (p == endptr) {
if (uvs >= 0xe0100 && uvs <= 0xe01ef) {
/* Ignore Ideographic Variation Sequence */
WARN("Ignored Variation Selector: CID=%u mapped to U+%04X U+%04X", cid, uc, uvs);
return uc;
}
}
WARN("CID=%u mapped to non-single Unicode characters...", cid);
return -1;
}
}

return -1;
Expand Down
22 changes: 11 additions & 11 deletions texk/dvipdfm-x/configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for dvipdfm-x (TeX Live) 20230429.
# Generated by GNU Autoconf 2.71 for dvipdfm-x (TeX Live) 20231118.
#
# Report bugs to <dvipdfmx@tug.org>.
#
Expand Down Expand Up @@ -629,8 +629,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='dvipdfm-x (TeX Live)'
PACKAGE_TARNAME='dvipdfm-x--tex-live-'
PACKAGE_VERSION='20230429'
PACKAGE_STRING='dvipdfm-x (TeX Live) 20230429'
PACKAGE_VERSION='20231118'
PACKAGE_STRING='dvipdfm-x (TeX Live) 20231118'
PACKAGE_BUGREPORT='dvipdfmx@tug.org'
PACKAGE_URL=''

Expand Down Expand Up @@ -1396,7 +1396,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures dvipdfm-x (TeX Live) 20230429 to adapt to many kinds of systems.
\`configure' configures dvipdfm-x (TeX Live) 20231118 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1468,7 +1468,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20230429:";;
short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20231118:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1598,7 +1598,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
dvipdfm-x (TeX Live) configure 20230429
dvipdfm-x (TeX Live) configure 20231118
generated by GNU Autoconf 2.71

Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2354,7 +2354,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by dvipdfm-x (TeX Live) $as_me 20230429, which was
It was created by dvipdfm-x (TeX Live) $as_me 20231118, which was
generated by GNU Autoconf 2.71. Invocation command line was

$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -8795,7 +8795,7 @@ fi

# Define the identity of the package.
PACKAGE='dvipdfm-x--tex-live-'
VERSION='20230429'
VERSION='20231118'


printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
Expand Down Expand Up @@ -15801,7 +15801,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."

lt_cl_version="\
dvipdfm-x (TeX Live) config.lt 20230429
dvipdfm-x (TeX Live) config.lt 20231118
configured by $0, generated by GNU Autoconf 2.71.

Copyright (C) 2011 Free Software Foundation, Inc.
Expand Down Expand Up @@ -17723,7 +17723,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by dvipdfm-x (TeX Live) $as_me 20230429, which was
This file was extended by dvipdfm-x (TeX Live) $as_me 20231118, which was
generated by GNU Autoconf 2.71. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -17795,7 +17795,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
dvipdfm-x (TeX Live) config.status 20230429
dvipdfm-x (TeX Live) config.status 20231118
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion texk/dvipdfm-x/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dnl This file is free software; the copyright holder
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
AC_INIT([dvipdfm-x (TeX Live)], [20230429], [dvipdfmx@tug.org])
AC_INIT([dvipdfm-x (TeX Live)], [20231118], [dvipdfmx@tug.org])
AC_PREREQ([2.65])
AC_CONFIG_SRCDIR([agl.c])
AC_CONFIG_AUX_DIR([../../build-aux])
Expand Down
Loading

0 comments on commit 250a609

Please sign in to comment.