diff options
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeX_ext.c | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeX_ext.h | 3 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeX_mac.c | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/xetex.h | 2 |
5 files changed, 15 insertions, 14 deletions
diff --git a/Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp b/Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp index 218843c2740..676759a0cc4 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp +++ b/Build/source/texk/web2c/xetexdir/XeTeXFontInst.cpp @@ -106,12 +106,16 @@ _get_glyph_advance(FT_Face face, FT_UInt gid, bool vertical) if (vertical) flags |= FT_LOAD_VERTICAL_LAYOUT; - error = FT_Get_Advance(face, gid, ftLoadFlags, &advance); + error = FT_Get_Advance(face, gid, flags, &advance); if (error) advance = 0; else advance = advance >> 10; + /* FreeType's vertical metrics grows downward */ + if (vertical) + advance = -advance; + return advance; } diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c index 4a53cdac119..cc27215426c 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c +++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c @@ -2902,16 +2902,6 @@ makeutf16name() } -int getcpcode(int fontNum, unsigned int code, int side) -{ - return get_cp_code(fontNum, code, side); -} - -void setcpcode(int fontNum, unsigned int code, int side, int value) -{ - set_cp_code(fontNum, code, side, value); -} - integer get_native_word_cp(void* pNode, int side) { memoryword* node = (memoryword*)pNode; diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.h b/Build/source/texk/web2c/xetexdir/XeTeX_ext.h index 9faf51cc519..d5cb931c692 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.h +++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.h @@ -281,6 +281,9 @@ typedef void* CFDictionaryRef; /* dummy declaration just so the stubs can compil /* the metrics params here are really TeX 'scaled' (or MacOS 'Fixed') values, but that typedef isn't available every place this is included */ void aatgetfontmetrics(CFDictionaryRef attrs, integer* ascent, integer* descent, integer* xheight, integer* capheight, integer* slant); + void set_cp_code(int fontNum, unsigned int code, int side, int value); + int get_cp_code(int fontNum, unsigned int code, int side); + #ifdef XETEX_MAC /* functions in XeTeX_mac.c */ diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_mac.c b/Build/source/texk/web2c/xetexdir/XeTeX_mac.c index 44a45692d4b..fca095e2b36 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_mac.c +++ b/Build/source/texk/web2c/xetexdir/XeTeX_mac.c @@ -882,12 +882,14 @@ find_pic_file(char** path, realrect* bounds, int pdfBoxType, int page) CFNumberRef DPIWidth = CFDictionaryGetValue(properties, kCGImagePropertyDPIWidth); CFNumberRef DPIHeight = CFDictionaryGetValue(properties, kCGImagePropertyDPIHeight); - if (imageWidth && imageHeight && DPIWidth && DPIHeight) { + if (imageWidth && imageHeight) { int w = 0, h = 0, hRes = 72, vRes = 72; CFNumberGetValue(imageWidth, kCFNumberIntType, &w); CFNumberGetValue(imageHeight, kCFNumberIntType, &h); - CFNumberGetValue(DPIWidth, kCFNumberIntType, &hRes); - CFNumberGetValue(DPIHeight, kCFNumberIntType, &vRes); + if (DPIWidth) + CFNumberGetValue(DPIWidth, kCFNumberIntType, &hRes); + if (DPIHeight) + CFNumberGetValue(DPIHeight, kCFNumberIntType, &vRes); bounds->x = 0; bounds->y = 0; diff --git a/Build/source/texk/web2c/xetexdir/xetex.h b/Build/source/texk/web2c/xetexdir/xetex.h index 5e990bc7c05..ebce1151bff 100644 --- a/Build/source/texk/web2c/xetexdir/xetex.h +++ b/Build/source/texk/web2c/xetexdir/xetex.h @@ -58,6 +58,8 @@ authorization from the copyright holders. #define makexdvglypharraydata(p) makeXDVGlyphArrayData(&(mem[p])) #define xdvbufferbyte(i) xdvbuffer[i] +#define getcpcode get_cp_code +#define setcpcode set_cp_code #define getnativewordcp(p,s) get_native_word_cp(&(mem[p]), s) #define pic_node_size 8 |