summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-01-21 13:53:22 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-01-21 13:53:22 +0000
commitc83c1f89e7f5ebae408a4a4c47339be0e33a67f4 (patch)
tree63e26b1ab4b33acdfd10973f82d5d25d8daca15c /Build
parent2b504f86dbc16352ac0ad43a9121b6e3fcdea7d1 (diff)
web2c/luatexdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@39447 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/luatexdir/font/vfovf.w6
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writet3.w36
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfgen.w2
3 files changed, 19 insertions, 25 deletions
diff --git a/Build/source/texk/web2c/luatexdir/font/vfovf.w b/Build/source/texk/web2c/luatexdir/font/vfovf.w
index 714ef0f87a9..80b35f9ea22 100644
--- a/Build/source/texk/web2c/luatexdir/font/vfovf.w
+++ b/Build/source/texk/web2c/luatexdir/font/vfovf.w
@@ -301,8 +301,10 @@ static int open_vf_file(const char *fn, unsigned char **vbuffer, int *vsize)
boolean file_read = false; /* was |vf_file| successfully read? */
FILE *vf_file;
const char *fname = luatex_find_file(fn, find_vf_file_callback);
- if (!fname)
- fname = fn;
+ if (fname == NULL || strlen(fname) == 0) {
+ /* fname = fn; */
+ return 0;
+ }
callback_id = callback_defined(read_vf_file_callback);
if (callback_id > 0) {
diff --git a/Build/source/texk/web2c/luatexdir/font/writet3.w b/Build/source/texk/web2c/luatexdir/font/writet3.w
index fcb1b30d72b..36a5e376d9c 100644
--- a/Build/source/texk/web2c/luatexdir/font/writet3.w
+++ b/Build/source/texk/web2c/luatexdir/font/writet3.w
@@ -99,13 +99,11 @@ static boolean writepk(PDF pdf, internal_font_number f)
pdffloat pf;
halfword *row;
char *name;
- char *ftemp = NULL;
chardesc cd;
boolean is_null_glyph, check_preamble;
int dpi;
int callback_id = 0;
int file_opened = 0;
- unsigned mallocsize = 0;
xfree(t3_buffer);
t3_curbyte = 0;
t3_size = 0;
@@ -113,33 +111,27 @@ static boolean writepk(PDF pdf, internal_font_number f)
callback_id = callback_defined(find_pk_file_callback);
if (callback_id > 0) {
+ /* <base>.dpi/<fontname>.<tdpi>pk */
dpi = round((float) pdf->pk_resolution *
(((float) font_size(f)) / (float) font_dsize(f)));
- /* <base>.dpi/<fontname>.<tdpi>pk */
cur_file_name = font_name(f);
- mallocsize = (unsigned) (strlen(cur_file_name) + 24 + 9);
- name = xmalloc(mallocsize);
- snprintf(name, (size_t) mallocsize, "%ddpi/%s.%dpk",
- (int) pdf->pk_resolution, cur_file_name, (int) dpi);
- if (run_callback(callback_id, "S->S", name, &ftemp)) {
- if (ftemp != NULL && strlen(ftemp)) {
- free(name);
- name = xstrdup(ftemp);
- free(ftemp);
- }
+ run_callback(callback_id, "Sd->S", cur_file_name, (int) dpi, &name);
+ if (name == NULL || strlen(name) == 0) {
+ formatted_warning("type 3","font %s at %i not found", cur_file_name, (int) dpi);
+ return false;
}
} else {
- dpi = (int)
- kpse_magstep_fix((unsigned) round
- ((float) pdf->pk_resolution *
- ((float) font_size(f) / (float) font_dsize(f))),
- (unsigned) pdf->pk_resolution, NULL);
+ dpi = (int) kpse_magstep_fix(
+ (unsigned) round ((float)pdf->pk_resolution * ((float)font_size(f)/(float)font_dsize(f))),
+ (unsigned) pdf->pk_resolution, NULL
+ );
cur_file_name = font_name(f);
name = kpse_find_pk(cur_file_name, (unsigned) dpi, &font_ret);
if (name == NULL ||
!FILESTRCASEEQ(cur_file_name, font_ret.name) ||
!kpse_bitmap_tolerance((float) font_ret.dpi, (float) dpi)) {
formatted_error("type 3","font %s at %i not found", cur_file_name, (int) dpi);
+ return false;
}
}
callback_id = callback_defined(read_pk_file_callback);
@@ -166,8 +158,8 @@ static boolean writepk(PDF pdf, internal_font_number f)
if (!pdf_char_marked(f, cd.charcode))
continue;
t3_char_widths[cd.charcode] = (float)
- pk_char_width(f, get_charwidth(f, cd.charcode),
- pdf->decimal_digits, pdf->pk_scale_factor);
+/* pk_char_width(f, get_charwidth(f, cd.charcode), pdf->decimal_digits, pdf->pk_scale_factor);*/
+ pk_char_width(f, get_charwidth(f, cd.charcode), 3, pdf->pk_scale_factor);
if (cd.cwidth < 1 || cd.cheight < 1) {
cd.xescape = cd.cwidth = round(t3_char_widths[cd.charcode] / 100.0);
cd.cheight = 1;
@@ -269,8 +261,8 @@ void writet3(PDF pdf, internal_font_number f)
pdf_out(pdf, '\n');
}
if (is_pk_font) {
- pk_font_scale =
- get_pk_font_scale(f, pdf->decimal_digits, pdf->pk_scale_factor);
+/* pk_font_scale = get_pk_font_scale(f, pdf->decimal_digits, pdf->pk_scale_factor); */
+ pk_font_scale = get_pk_font_scale(f, 3, pdf->pk_scale_factor);
pdf_add_name(pdf, "FontMatrix");
pdf_begin_array(pdf);
setpdffloat(pf, (int64_t) pk_font_scale, 5);
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
index dfbbe3098ee..b5294954e6d 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
@@ -932,7 +932,7 @@ static void init_pdf_outputparameters(PDF pdf)
}
if (pdf->pk_resolution == 0) /* if not set from format file or by user */
pdf->pk_resolution = pk_dpi; /* take it from \.{texmf.cnf} */
- pdf->pk_scale_factor = divide_scaled(72, pdf->pk_resolution, 5 + pdf->decimal_digits);
+ pdf->pk_scale_factor = divide_scaled(72, pdf->pk_resolution, 3+5); /* (pdf->decimal_digits < 4 ? 8 : 9));*/
if (!callback_defined(read_pk_file_callback)) {
pk_mode = pdf_pk_mode; /* lookup once */
if (pk_mode != null) {