diff options
author | Jonathan Kew <jfkthame@googlemail.com> | 2008-03-05 14:09:42 +0000 |
---|---|---|
committer | Jonathan Kew <jfkthame@googlemail.com> | 2008-03-05 14:09:42 +0000 |
commit | a8558f6a9e4f5c968d90f47e9274c415c7aa023e (patch) | |
tree | 99e64c2f7817b8dee26085962b6ac133311f4d22 /Build | |
parent | ba66bff99b5f90d3af25cbd6b4d186b6d852c544 (diff) |
xetex updates from svn rev.594, incl. synctex support
git-svn-id: svn://tug.org/texlive/trunk@6865 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeXFontMgr.h | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeXOTLayoutEngine.cpp | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeXOTLayoutEngine.h | 1 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeXOTMath.h | 13 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeX_ext.c | 51 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeX_ext.h | 23 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeX_mac.c | 42 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/sync-xetex.ch | 68 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/xetex.ch | 25 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/xetex.defines | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/xetex.mk | 40 |
12 files changed, 218 insertions, 72 deletions
diff --git a/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.h b/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.h index 44e2bcade75..91df461f33d 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.h +++ b/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.h @@ -31,8 +31,6 @@ authorization from SIL International. #ifndef __XETEX_FONT_MANAGER_H #define __XETEX_FONT_MANAGER_H -#include "XeTeX_ext.h" - #ifdef XETEX_MAC #include <Carbon/Carbon.h> typedef ATSFontRef PlatformFontRef; @@ -43,6 +41,8 @@ typedef ATSFontRef PlatformFontRef; typedef FcPattern* PlatformFontRef; #endif +#include "XeTeX_ext.h" + #include "XeTeXLayoutInterface.h" #ifdef __cplusplus /* allow inclusion in plain C files just to get the typedefs above */ diff --git a/Build/source/texk/web2c/xetexdir/XeTeXOTLayoutEngine.cpp b/Build/source/texk/web2c/xetexdir/XeTeXOTLayoutEngine.cpp index 80a787b3469..c5934b98155 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeXOTLayoutEngine.cpp +++ b/Build/source/texk/web2c/xetexdir/XeTeXOTLayoutEngine.cpp @@ -94,6 +94,7 @@ LayoutEngine* XeTeXOTLayoutEngine::LayoutEngineFactory case guruScriptCode: case tamlScriptCode: case teluScriptCode: + case sinhScriptCode: // result = new XeTeXIndicLayoutEngine(fontInstance, scriptTag, languageTag, gsubTable, addFeatures, removeFeatures); result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); break; @@ -114,6 +115,10 @@ LayoutEngine* XeTeXOTLayoutEngine::LayoutEngineFactory result = new XeTeXHanLayoutEngine(fontInstance, scriptTag, languageTag, gsubTable, gposTable, addFeatures, addParams, removeFeatures); break; + case tibtScriptCode: + result = new TibetanOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); + break; + case khmrScriptCode: result = new KhmerOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); break; @@ -134,11 +139,12 @@ LayoutEngine* XeTeXOTLayoutEngine::LayoutEngineFactory case guruScriptCode: case tamlScriptCode: case teluScriptCode: + case sinhScriptCode: result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); break; case arabScriptCode: - case hebrScriptCode: +// case hebrScriptCode: result = new UnicodeArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); break; diff --git a/Build/source/texk/web2c/xetexdir/XeTeXOTLayoutEngine.h b/Build/source/texk/web2c/xetexdir/XeTeXOTLayoutEngine.h index 2800ab21b76..fe8c60e29d8 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeXOTLayoutEngine.h +++ b/Build/source/texk/web2c/xetexdir/XeTeXOTLayoutEngine.h @@ -35,6 +35,7 @@ authorization from SIL International. #include "ArabicLayoutEngine.h" #include "IndicLayoutEngine.h" #include "HanLayoutEngine.h" +#include "TibetanLayoutEngine.h" #include "XeTeXFontInst.h" diff --git a/Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp b/Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp index 3aebc8b9a97..c690c683c8c 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp +++ b/Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp @@ -28,10 +28,13 @@ use or other dealings in this Software without prior written authorization from SIL International. \****************************************************************************/ +#define XETEX_OT_MATH_IMPLEMENTATION 1 +#include "XeTeXOTMath.h" + #include "XeTeX_ext.h" #include "XeTeXLayoutInterface.h" #include "XeTeXFontInst.h" -#include "XeTeXOTMath.h" + #include "CoverageTables.h" #define kMATHTableTag 0x4D415448 diff --git a/Build/source/texk/web2c/xetexdir/XeTeXOTMath.h b/Build/source/texk/web2c/xetexdir/XeTeXOTMath.h index 5bb5bc83f23..654b2a4ac91 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeXOTMath.h +++ b/Build/source/texk/web2c/xetexdir/XeTeXOTMath.h @@ -31,12 +31,17 @@ authorization from SIL International. #ifndef __XETEX_OT_MATH__ #define __XETEX_OT_MATH__ +#ifdef XETEX_OT_MATH_IMPLEMENTATION #include "MathTable.h" - #include "LEFontInstance.h" +#else +#define GlyphAssembly void /* used when we're just declaring the functions for xetex.ch */ +#endif /* public "C" APIs for calling from Web(-to-C) code */ +#ifdef __cplusplus extern "C" { +#endif int getnativemathsyparam(int f, int n); int getnativemathexparam(int f, int n); int getotmathconstant(int f, int n); @@ -51,13 +56,15 @@ extern "C" { int otpartendconnector(int f, const GlyphAssembly* a, int i); int otpartfulladvance(int f, const GlyphAssembly* a, int i); int otminconnectoroverlap(int f); +#ifdef __cplusplus }; +#endif - +#ifdef XETEX_OT_MATH_IMPLEMENTATION /* internal functions */ /* get a math font constant, scaled according to the font size */ int getMathConstant(LEFontInstance* fontInst, mathConstantIndex whichConstant); - +#endif #endif diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c index df871ba4796..ec0f851f543 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c +++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c @@ -849,8 +849,6 @@ loadGraphiteFont(PlatformFontRef fontRef, XeTeXFont font, Fixed scaled_size, con const char* cp2; const char* cp3; - UInt32 tag; - UInt32 rgbValue = 0x000000FF; UInt32 languageTag = 0; @@ -2167,9 +2165,11 @@ measure_native_glyph(void* pNode, int use_glyph_metrics) ATSGlyphIdealMetrics metrics; OSStatus status = ATSUGlyphGetIdealMetrics(style, 1, &gid, 0, &metrics); /* returns values in Quartz points, so we need to convert to TeX points */ - node_width(node) = X2Fix(metrics.advance.x * 72.27 / 72.0); - if (use_glyph_metrics) - GetGlyphHeightDepth_AAT(style, gid, &ht, &dp); + if (status == noErr) { + node_width(node) = X2Fix(metrics.advance.x * 72.27 / 72.0); + if (use_glyph_metrics) + GetGlyphHeightDepth_AAT(style, gid, &ht, &dp); + } } else #endif @@ -2261,10 +2261,6 @@ double Fix2X(Fixed f) #endif /* these are here, not XeTeX_mac.c, because we need stubs on other platforms */ -#ifndef XETEX_MAC -typedef void* ATSUStyle; /* dummy declaration just so the stubs can compile */ -#endif - void atsugetfontmetrics(ATSUStyle style, Fixed* ascent, Fixed* descent, Fixed* xheight, Fixed* capheight, Fixed* slant) { @@ -2489,13 +2485,13 @@ atsufontgetnamed(int what, ATSUStyle style) switch (what) { case XeTeX_find_variation_by_name: - rval = find_axis_by_name(fontID, nameoffile + 1, namelength); + rval = find_axis_by_name(fontID, (const char*)nameoffile + 1, namelength); if (rval == 0) rval = -1; break; case XeTeX_find_feature_by_name: - rval = find_feature_by_name(fontID, nameoffile + 1, namelength); + rval = find_feature_by_name(fontID, (const char*)nameoffile + 1, namelength); if (rval == 0x0000FFFF) rval = -1; break; @@ -2516,7 +2512,7 @@ atsufontgetnamed1(int what, ATSUStyle style, int param) switch (what) { case XeTeX_find_selector_by_name: - rval = find_selector_by_name(fontID, param, nameoffile + 1, namelength); + rval = find_selector_by_name(fontID, param, (const char*)nameoffile + 1, namelength); if (rval == 0x0000FFFF) rval = -1; break; @@ -2746,11 +2742,11 @@ open_dvi_output(FILE** fptr) cmd = cmd2; } if (output_directory) { - char *fullname = concat3(output_directory, "/", nameoffile+1); + char *fullname = concat3(output_directory, "/", (const char*)nameoffile+1); free(nameoffile); namelength = strlen(fullname); - nameoffile = (char*)xmalloc(namelength+2); - strcpy(nameoffile+1, fullname); + nameoffile = (unsigned char*)xmalloc(namelength+2); + strcpy((char*)nameoffile+1, fullname); free(fullname); } *fptr = popen(cmd, "w"); @@ -2768,13 +2764,14 @@ dviclose(FILE* fptr) } else return pclose(fptr); + return 0; } int get_uni_c(UFILE* f) { int rval; - unsigned c; + int c; if (f->savedChar != -1) { rval = f->savedChar; @@ -2784,21 +2781,10 @@ get_uni_c(UFILE* f) switch (f->encodingMode) { case UTF8: - /* FIXME: we don't currently check for malformed UTF-8 */ c = rval = getc(f->f); if (rval != EOF) { UInt16 extraBytes = bytesFromUTF8[rval]; switch (extraBytes) { /* note: code falls through cases! */ - default: - bad_utf8: - if (rval > 0x100) - rval = 0xfffd; - f->savedChar = c; - case 5: - case 4: - badutf8warning(); - f->encodingMode = RAW; - return rval; case 3: c = getc(f->f); if (c < 0x80 || c >= 0xc0) goto bad_utf8; rval <<= 6; rval += c; @@ -2808,7 +2794,16 @@ get_uni_c(UFILE* f) case 1: c = getc(f->f); if (c < 0x80 || c >= 0xc0) goto bad_utf8; rval <<= 6; rval += c; - case 0: ; + case 0: + break; + + bad_utf8: + if (c != EOF) + ungetc(c, f->f); + case 5: + case 4: + badutf8warning(); + return 0xfffd; /* return without adjusting by offsetsFromUTF8 */ }; rval -= offsetsFromUTF8[extraBytes]; } diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.h b/Build/source/texk/web2c/xetexdir/XeTeX_ext.h index b273bc7dabd..843758bf75a 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.h +++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.h @@ -210,6 +210,8 @@ extern const UInt32 byteMark; #include "trans.h" +#include "XeTeXLayoutInterface.h" + #ifdef __cplusplus extern "C" { #endif @@ -255,6 +257,7 @@ extern "C" { integer mapglyphtoindex(integer font); integer getfontcharrange(integer font, int first); void printglyphname(integer font, integer gid); + UInt16 get_native_glyph_id(void* pNode, unsigned index); void grprintfontname(integer what, void* pEngine, integer param1, integer param2); integer grfontgetnamed(integer what, void* pEngine); @@ -274,6 +277,22 @@ extern "C" { int input_line(UFILE* f); void makeutf16name(); + int initpool(); + void terminatefontmanager(); + int maketexstring(const char* s); + +#ifndef XETEX_MAC +typedef void* ATSUStyle; /* dummy declaration just so the stubs can compile */ +#endif + + int atsufontget(int what, ATSUStyle style); + int atsufontget1(int what, ATSUStyle style, int param); + int atsufontget2(int what, ATSUStyle style, int param1, int param2); + int atsufontgetnamed(int what, ATSUStyle style); + int atsufontgetnamed1(int what, ATSUStyle style, int param); + void atsuprintfontname(int what, ATSUStyle style, int param1, int param2); + void atsugetfontmetrics(ATSUStyle style, Fixed* ascent, Fixed* descent, Fixed* xheight, Fixed* capheight, Fixed* slant); + #ifdef XETEX_MAC /* functions in XeTeX_mac.c */ void* loadAATfont(ATSFontRef fontRef, integer scaled_size, const char* cp1); @@ -287,11 +306,15 @@ extern "C" { float GetGlyphItalCorr_AAT(ATSUStyle style, UInt16 gid); char* GetGlyphName_AAT(ATSUStyle style, UInt16 gid, int* len); int GetFontCharRange_AAT(ATSUStyle style, int reqFirst); + ATSUFontVariationAxis find_axis_by_name(ATSUFontID fontID, const char* name, int nameLength); + ATSUFontFeatureType find_feature_by_name(ATSUFontID fontID, const char* name, int nameLength); + ATSUFontFeatureSelector find_selector_by_name(ATSUFontID fontID, ATSUFontFeatureType featureType, const char* name, int nameLength); #endif #ifdef __cplusplus }; #endif +#include "XeTeXOTMath.h" /* some Mac OS X functions that we provide ourselves for other platforms */ #ifndef XETEX_MAC diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_mac.c b/Build/source/texk/web2c/xetexdir/XeTeX_mac.c index 121e431ca0d..7cbf43bedc4 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_mac.c +++ b/Build/source/texk/web2c/xetexdir/XeTeX_mac.c @@ -47,6 +47,7 @@ authorization from SIL International. #include "TECkit_Engine.h" #include "XeTeX_ext.h" +#include "XeTeXLayoutInterface.h" #include "XeTeXswap.h" @@ -377,7 +378,10 @@ float GetGlyphWidth_AAT(ATSUStyle style, UInt16 gid) { ATSGlyphIdealMetrics metrics; OSStatus status = ATSUGlyphGetIdealMetrics(style, 1, &gid, 0, &metrics); - return PStoTeXPoints(metrics.advance.x); + if (status == noErr) + return PStoTeXPoints(metrics.advance.x); + else + return 0; } void GetGlyphHeightDepth_AAT(ATSUStyle style, UInt16 gid, float* ht, float* dp) @@ -396,10 +400,15 @@ void GetGlyphSidebearings_AAT(ATSUStyle style, UInt16 gid, float* lsb, float* rs { ATSGlyphIdealMetrics metrics; OSStatus status = ATSUGlyphGetIdealMetrics(style, 1, &gid, 0, &metrics); - GlyphBBox bbox; - GetGlyphBBox_AAT(style, gid, &bbox); - *lsb = bbox.xMin; - *rsb = PStoTeXPoints(metrics.advance.x) - bbox.xMax; + if (status == noErr) { + GlyphBBox bbox; + GetGlyphBBox_AAT(style, gid, &bbox); + *lsb = bbox.xMin; + *rsb = PStoTeXPoints(metrics.advance.x) - bbox.xMax; + } + else { + *lsb = *rsb = 0; + } } float GetGlyphItalCorr_AAT(ATSUStyle style, UInt16 gid) @@ -407,10 +416,12 @@ float GetGlyphItalCorr_AAT(ATSUStyle style, UInt16 gid) float rval = 0.0; ATSGlyphIdealMetrics metrics; OSStatus status = ATSUGlyphGetIdealMetrics(style, 1, &gid, 0, &metrics); - GlyphBBox bbox; - GetGlyphBBox_AAT(style, gid, &bbox); - if (bbox.xMax > PStoTeXPoints(metrics.advance.x)) - rval = bbox.xMax - PStoTeXPoints(metrics.advance.x); + if (status == noErr) { + GlyphBBox bbox; + GetGlyphBBox_AAT(style, gid, &bbox); + if (bbox.xMax > PStoTeXPoints(metrics.advance.x)) + rval = bbox.xMax - PStoTeXPoints(metrics.advance.x); + } return rval; } @@ -432,15 +443,20 @@ int MapCharToGlyph_AAT(ATSUStyle style, UInt32 ch) txt[0] = ch; OSStatus status = ATSUSetTextPointerLocation(sTextLayout, &txt[0], 0, len, len); + if (status != noErr) + return 0; status = ATSUSetRunStyle(sTextLayout, style, 0, len); + if (status != noErr) + return 0; ByteCount bufferSize = sizeof(ATSUGlyphInfoArray); ATSUGlyphInfoArray info; status = ATSUGetGlyphInfo(sTextLayout, 0, len, &bufferSize, &info); - if (bufferSize > 0 && info.numGlyphs > 0) - return info.glyphs[0].glyphID; - else - return 0; + if (status == noErr) { + if (bufferSize > 0 && info.numGlyphs > 0) + return info.glyphs[0].glyphID; + } + return 0; } int MapGlyphToIndex_AAT(ATSUStyle style, const char* glyphName) diff --git a/Build/source/texk/web2c/xetexdir/sync-xetex.ch b/Build/source/texk/web2c/xetexdir/sync-xetex.ch new file mode 100644 index 00000000000..d25d1a21b26 --- /dev/null +++ b/Build/source/texk/web2c/xetexdir/sync-xetex.ch @@ -0,0 +1,68 @@ +This file contains XeTeX changes for synctex support, +closely based on a patch to pdftex.web by Jérôme Laurens. + +****************************************************************************** +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL SIL INTERNATIONAL BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of SIL International +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in this Software without prior written +authorization from SIL International. +****************************************************************************** + +@x +@d synctex_field_size=MISSING IMPLEMENTATION +@y +@d synctex_field_size=1 {Declare the {\sl synctex} field size to store the {\sl synctex} information: + we will put file tag and line into lh and rh fields of one word} +@z + +@x + MISSING IMPLEMENTATION: 0 synctag for medium sized node at mem[t] +@y + mem[t+medium_node_size-synctex_field_size].hh.lh:=0; {{\sl synctex}: do nothing, it is too late} +@z + +@x +MISSING IMPLEMENTATION: 0 synctag for medium sized node at mem[p] +@y +mem[p+medium_node_size-synctex_field_size].hh.lh:=0; {{\sl synctex}: do nothing, it is too late} +@z + +@x + MISSING IMPLEMENTATION: update the synctex information for node at mem[r] with size s +@y + mem[r+s-synctex_field_size].hh.lh := synctex_tag; + mem[r+s-synctex_field_size].hh.rh := line; +@z + +@x +MISSING IMPLEMENTATION: copy the synctex information for box node at mem[r] from node at mem[p] +@y +mem[r+box_node_size-synctex_field_size].hh.lh:=mem[p+box_node_size-synctex_field_size].hh.lh; +mem[r+box_node_size-synctex_field_size].hh.rh:=mem[p+box_node_size-synctex_field_size].hh.rh; +@z + +@x +MISSING IMPLEMENTATION: copy the synctex information for glue node at mem[r] from node at mem[p] +@y +mem[r+medium_node_size-synctex_field_size].hh.lh:=mem[p+medium_node_size-synctex_field_size].hh.lh; +mem[r+medium_node_size-synctex_field_size].hh.rh:=mem[p+medium_node_size-synctex_field_size].hh.rh; +@z diff --git a/Build/source/texk/web2c/xetexdir/xetex.ch b/Build/source/texk/web2c/xetexdir/xetex.ch index 87a5869b158..618292f7434 100644 --- a/Build/source/texk/web2c/xetexdir/xetex.ch +++ b/Build/source/texk/web2c/xetexdir/xetex.ch @@ -509,8 +509,18 @@ else begin @z @x +@!init function get_strings_started:boolean; {initializes the string pool, + but returns |false| if something goes wrong} +label done,exit; +var k,@!l:0..255; {small indices or counters} +@!m,@!n:text_char; {characters input from |pool_file|} +@!g:str_number; {garbage} +@!a:integer; {accumulator for check sum} +@!c:boolean; {check sum has been checked} begin pool_ptr:=0; str_ptr:=0; str_start[0]:=0; @y +@!init function get_strings_started:boolean; {initializes the string pool, + but returns |false| if something goes wrong} begin pool_ptr:=0; str_ptr:=0; @z @@ -3797,9 +3807,13 @@ if upwards then cur_v:=cur_v-rule_ht else cur_v:=cur_v+rule_ht; @z @x -begin if tracing_output>0 then +begin +@<Record sheet {\sl synctex} information@> +if tracing_output>0 then @y -begin if job_name=0 then open_log_file; +begin +if job_name=0 then open_log_file; +@<Record sheet {\sl synctex} information@> if tracing_output>0 then @z @@ -7454,7 +7468,6 @@ var corners: array[0..3] of real_point; x_size_req,y_size_req: real; check_keywords: boolean; - x_size, y_size: real; xmin,xmax,ymin,ymax: real; i: small_number; page: integer; @@ -8714,17 +8727,15 @@ begin end; procedure bad_utf8_warning; -var - i: integer; begin begin_diagnostic; - print_nl("Invalid UTF-8 byte sequence"); + print_nl("Invalid UTF-8 byte or sequence"); if terminal_input then print(" in terminal input") else begin print(" at line "); print_int(line); end; - print("; reading remainder as raw bytes."); + print(" replaced by U+FFFD."); end_diagnostic(false); end; diff --git a/Build/source/texk/web2c/xetexdir/xetex.defines b/Build/source/texk/web2c/xetexdir/xetex.defines index 6e8cb936507..4374d18fe5f 100644 --- a/Build/source/texk/web2c/xetexdir/xetex.defines +++ b/Build/source/texk/web2c/xetexdir/xetex.defines @@ -169,3 +169,13 @@ authorization from SIL International. @define function wdField(); @define function htField(); @define function applymapping(); + +{ functions from the synctex controller in synctex.h } +@define procedure synctexstartinput; +@define procedure synctexsheet(); +@define procedure synctexhlist(); +@define procedure synctextsilh(); +@define procedure synctexmath(); +@define procedure synctexkern(); +@define procedure synctexglue(); + diff --git a/Build/source/texk/web2c/xetexdir/xetex.mk b/Build/source/texk/web2c/xetexdir/xetex.mk index b813647d8fc..b7dc7eb3a95 100644 --- a/Build/source/texk/web2c/xetexdir/xetex.mk +++ b/Build/source/texk/web2c/xetexdir/xetex.mk @@ -128,45 +128,49 @@ xetexdir/etex.version: $(srcdir)/etexdir/etex.ch # The C sources. xetex_c = xetexini.c xetex0.c xetex1.c xetex2.c xetex_o = xetexini.o xetex0.o xetex1.o xetex2.o xetexextra.o -xetex_add_o = trans.o XeTeX_ext.o xetex_pool.o $(xetex_platform_o) +xetex_add_o = trans.o XeTeX_ext.o xetex_pool.o xetex_synctex.o $(xetex_platform_o) # these compilations require the path to TECkit headers; # just setting it in XCFLAGS doesn't seem to work when we're called # recursively from "make world" etc xetexini.o: xetexini.c $(srcdir)/xetexdir/XeTeX_ext.h - $(compile) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ + $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ xetex0.o: xetex0.c $(srcdir)/xetexdir/XeTeX_ext.h - $(compile) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ + $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ xetex1.o: xetex1.c $(srcdir)/xetexdir/XeTeX_ext.h - $(compile) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ + $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ xetex2.o: xetex2.c $(srcdir)/xetexdir/XeTeX_ext.h - $(compile) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ + $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ xetexextra.o: xetexextra.c $(srcdir)/xetexdir/XeTeX_ext.h - $(compile) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ + $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ xetex_pool.o: xetex_pool.c $(srcdir)/xetexdir/XeTeX_ext.h - $(compile) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ + $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ # image support mfileio.o: $(srcdir)/xetexdir/mfileio.c $(srcdir)/xetexdir/mfileio.h - $(compile) $(ALL_CFLAGS) -c $< -o $@ + $(compile) $(ALL_CFLAGS) $(FTFLAGS) -c $< -o $@ numbers.o: $(srcdir)/xetexdir/numbers.c $(srcdir)/xetexdir/numbers.h - $(compile) $(ALL_CFLAGS) -c $< -o $@ + $(compile) $(ALL_CFLAGS) $(FTFLAGS) -c $< -o $@ bmpimage.o: $(srcdir)/xetexdir/bmpimage.c $(srcdir)/xetexdir/bmpimage.h - $(compile) $(ALL_CFLAGS) -c $< -o $@ + $(compile) $(ALL_CFLAGS) $(FTFLAGS) -c $< -o $@ jpegimage.o: $(srcdir)/xetexdir/jpegimage.c $(srcdir)/xetexdir/jpegimage.h - $(compile) $(ALL_CFLAGS) -c $< -o $@ + $(compile) $(ALL_CFLAGS) $(FTFLAGS) -c $< -o $@ pngimage.o: $(srcdir)/xetexdir/pngimage.c $(srcdir)/xetexdir/pngimage.h - $(compile) $(ALL_CFLAGS) $(LIBPNGCPPFLAGS) $(ZLIBCPPFLAGS) -c $< -o $@ + $(compile) $(ALL_CFLAGS) $(FTFLAGS) $(LIBPNGCPPFLAGS) $(ZLIBCPPFLAGS) -c $< -o $@ pdfimage.o: $(srcdir)/xetexdir/pdfimage.cpp $(srcdir)/xetexdir/pdfimage.h - $(CXX) $(ALL_CFLAGS) $(LIBXPDFCPPFLAGS) -c $< -o $@ + $(CXX) $(ALL_CFLAGS) $(FTFLAGS) $(LIBXPDFCPPFLAGS) -c $< -o $@ XeTeX_pic.o: $(srcdir)/xetexdir/XeTeX_pic.c $(srcdir)/xetexdir/XeTeX_ext.h $(XeTeXImageHdrs) - $(compile) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ + $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ + +# sync +xetex_synctex.o: $(srcdir)/synctex/synctex.c + $(compile) $(ALL_CFLAGS) $(TECKITFLAGS) $(FTFLAGS) $(XETEX_DEFINES) -c $< -o $@ # Layout library xetex_ot_layout_o = \ @@ -188,7 +192,7 @@ XeTeXFontMgr_FC.o: $(srcdir)/xetexdir/XeTeXFontMgr_FC.cpp $(XeTeXFontHdrs) $(CXX) $(ICUCFLAGS) $(FTFLAGS) $(FONTCONFIGCPPFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ XeTeXFontMgr_Mac.o: $(srcdir)/xetexdir/XeTeXFontMgr_Mac.mm $(XeTeXFontHdrs) - gcc -ObjC++ $(ICUCFLAGS) $(FTFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ + $(CXX) -ObjC++ $(ICUCFLAGS) $(FTFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ cmaps.o: $(srcdir)/xetexdir/cmaps.cpp $(CXX) $(ICUCFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ @@ -247,11 +251,13 @@ xetex.p xetex.pool: ./otangle xetex.web # Sources for xetex.web: xetex_web_srcs = $(srcdir)/tex.web \ $(srcdir)/etexdir/etex.ch \ + $(srcdir)/synctex/synctex.ch \ $(srcdir)/etexdir/tex.ch0 \ $(srcdir)/tex.ch \ $(srcdir)/etexdir/tex.ch1 \ $(srcdir)/etexdir/tex.ech \ - $(srcdir)/xetexdir/xetex.ch + $(srcdir)/xetexdir/xetex.ch \ + $(srcdir)/xetexdir/sync-xetex.ch xetex.web: tie xetexdir/xetex.mk $(xetex_web_srcs) $(TIE) -m xetex.web $(xetex_web_srcs) @@ -286,7 +292,7 @@ xetex-clean: # etrip-clean $(LIBTOOL) --mode=clean $(RM) xetex rm -f $(xetex_o) $(xetex_c) xetexextra.c xetex_pool.c xetexcoerce.h xetexd.h rm -f xetexdir/xetexextra.h xetexdir/xetex.version - rm -f xetex.p xetex.pool xetex.web xetex.ch + rm -f xetex.p xetex.pool xetex.web rm -f xetex.fmt xetex.log rm -f hello.dvi hello.log xfoo.out openout.log one.two.log uno.log rm -f just.log batch.log write18.log mltextst.log texput.log |