summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/dvipdfm-x/ChangeLog5
-rw-r--r--Build/source/texk/dvipdfm-x/numbers.c10
-rw-r--r--Build/source/texk/dvipdfm-x/numbers.h3
-rw-r--r--Build/source/texk/dvipdfm-x/tfm.c29
4 files changed, 35 insertions, 12 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog
index 92b25c4945f..ebd6258ceac 100644
--- a/Build/source/texk/dvipdfm-x/ChangeLog
+++ b/Build/source/texk/dvipdfm-x/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-27 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ * tfm.c, number.[ch]: Support new JFM spec (3-byte characters
+ in TYPE > 0).
+
2017-12-21 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* jpegimage.c: If j_info->xdpi and j_info->ydpi are not
diff --git a/Build/source/texk/dvipdfm-x/numbers.c b/Build/source/texk/dvipdfm-x/numbers.c
index 50bfd2f5427..dd616c66ebc 100644
--- a/Build/source/texk/dvipdfm-x/numbers.c
+++ b/Build/source/texk/dvipdfm-x/numbers.c
@@ -84,6 +84,16 @@ unsigned int get_unsigned_triple(FILE *file)
return triple;
}
+#ifndef WITHOUT_ASCII_PTEX
+unsigned int get_unsigned_triple_kanji(FILE *file)
+{
+ unsigned int triple = get_unsigned_byte(file);
+ triple = (triple << 8) | get_unsigned_byte(file);
+ triple = triple | (get_unsigned_byte(file)<<16);
+ return triple;
+}
+#endif
+
signed int get_signed_triple(FILE *file)
{
int i;
diff --git a/Build/source/texk/dvipdfm-x/numbers.h b/Build/source/texk/dvipdfm-x/numbers.h
index bf671f33553..7e9e290fdd3 100644
--- a/Build/source/texk/dvipdfm-x/numbers.h
+++ b/Build/source/texk/dvipdfm-x/numbers.h
@@ -59,6 +59,9 @@ extern unsigned short get_unsigned_pair (FILE *);
extern unsigned short sget_unsigned_pair (unsigned char *);
extern signed short get_signed_pair (FILE *);
extern unsigned int get_unsigned_triple (FILE *);
+#ifndef WITHOUT_ASCII_PTEX
+extern unsigned int get_unsigned_triple_kanji (FILE *);
+#endif
extern signed int get_signed_triple (FILE *);
extern int32_t get_signed_quad (FILE *);
extern uint32_t get_unsigned_quad (FILE *);
diff --git a/Build/source/texk/dvipdfm-x/tfm.c b/Build/source/texk/dvipdfm-x/tfm.c
index 8e2b26cc9fb..3a8b0b61d56 100644
--- a/Build/source/texk/dvipdfm-x/tfm.c
+++ b/Build/source/texk/dvipdfm-x/tfm.c
@@ -52,7 +52,7 @@ static int verbose = 0;
#define JFMV_ID 9
#define IS_JFM(i) ((i) == JFM_ID || (i) == JFMV_ID)
-#define CHARACTER_INDEX(i) ((i > 0xFFFFUL ? 0x10000UL : i))
+#define CHARACTER_INDEX(i) ((i > 0x10FFFFUL ? 0x110000UL : i))
#else
#define CHARACTER_INDEX(i) ((i))
#endif
@@ -83,7 +83,7 @@ struct tfm_font
#endif /* !WITHOUT_OMEGA */
fixword *header;
#ifndef WITHOUT_ASCII_PTEX
- unsigned short *chartypes;
+ unsigned int *chartypes;
#endif /* !WITHOUT_ASCII_PTEX */
uint32_t *char_info;
unsigned short *width_index;
@@ -181,7 +181,11 @@ struct range_map {
struct char_map
{
struct coverage coverage;
+#ifndef WITHOUT_ASCII_PTEX
+ unsigned int *indices;
+#else
unsigned short *indices;
+#endif
};
static void
@@ -454,17 +458,18 @@ tfm_get_sizes (FILE *tfm_file, off_t tfm_file_size, struct tfm_font *tfm)
static void
jfm_do_char_type_array (FILE *tfm_file, struct tfm_font *tfm)
{
- unsigned short charcode;
+ unsigned int charcode;
unsigned short chartype;
- int i;
+ unsigned int i;
- tfm->chartypes = NEW(65536, unsigned short);
- for (i = 0; i < 65536; i++) {
+ tfm->chartypes = NEW(1114112, unsigned int);
+ for (i = 0; i < 1114112; i++) {
tfm->chartypes[i] = 0;
}
for (i = 0; i < tfm->nt; i++) {
- charcode = get_unsigned_pair(tfm_file);
- chartype = get_unsigned_pair(tfm_file);
+ /* support new JFM spec by texjporg */
+ charcode = get_unsigned_triple_kanji(tfm_file);
+ chartype = get_unsigned_byte(tfm_file);
tfm->chartypes[charcode] = chartype;
}
}
@@ -481,14 +486,14 @@ jfm_make_charmap (struct font_metric *fm, struct tfm_font *tfm)
map->coverage.first_char = 0;
#ifndef WITHOUT_ASCII_PTEX
map->coverage.num_chars = 0x10FFFFL;
- map->indices = NEW(0x10001L, unsigned short);
- map->indices[0x10000L] = tfm->chartypes[0];
+ map->indices = NEW(0x110001L, unsigned int);
+ map->indices[0x110000L] = tfm->chartypes[0];
+ for (code = 0; code <= 0x10FFFFU; code++) {
#else
map->coverage.num_chars = 0xFFFFL;
map->indices = NEW(0x10000L, unsigned short);
-#endif
-
for (code = 0; code <= 0xFFFFU; code++) {
+#endif
map->indices[code] = tfm->chartypes[code];
}
} else {