diff options
24 files changed, 745 insertions, 301 deletions
diff --git a/Build/source/texk/web2c/xetexdir/COPYING b/Build/source/texk/web2c/xetexdir/COPYING index 47db7a1d747..9543cf2d52a 100644 --- a/Build/source/texk/web2c/xetexdir/COPYING +++ b/Build/source/texk/web2c/xetexdir/COPYING @@ -4,8 +4,9 @@ The XeTeX changes/additions are Copyright (c) 1994-2008 by SIL International Copyright (c) 2009-2012 by Jonathan Kew - Copyright (c) 2010-2012 Han Han The Thanh - Copyright (c) 2012 by Khaled Hosny + Copyright (c) 2010-2012 by Han The Thanh + Copyright (c) 2012-2013 by Khaled Hosny + Copyright (c) 2012-2013 by Jiang Jiang For full copyright notices consult the individual files in the package. diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog index 594a24301e6..cfb03b10406 100644 --- a/Build/source/texk/web2c/xetexdir/ChangeLog +++ b/Build/source/texk/web2c/xetexdir/ChangeLog @@ -1,3 +1,7 @@ +2013-03-22 Khaled Hosny <khaledhosny@eglug.org> + + XeTeX 0.9999.1 + 2013-03-12 Khaled Hosny <khaledhosny@eglug.org> * xetex.web: Fix \XeTeXrevision. diff --git a/Build/source/texk/web2c/xetexdir/NEWS b/Build/source/texk/web2c/xetexdir/NEWS new file mode 100644 index 00000000000..7dab0e1b6e6 --- /dev/null +++ b/Build/source/texk/web2c/xetexdir/NEWS @@ -0,0 +1,134 @@ +============================================================== +XeTeX 0.9999.1 was released 20130322 +============================================================== + +XeTeX: +* Fix loading font files on PPC Mac OS 10.5 (and potentially other versions of + Mac). + +* Fix handling of ‘script’ and ‘language’ font options to be treated again as + OpenType not ISO tags, so that passing version 2 Indic script tags works + (though this is generally not needed as HarfBuzz will always use version 2 + shaping if the font has it, regardless of the tag used). + +* Fix loading JPEG images that do not specify a resolution. + +* When printing multi-byte characters to log or terminal avoid inserting new + lines in the middle of the characters, and count the characters not the bytes + when calculating line length. + +* Update to HarfBuzz 0.9.14, a couple of Indic and Hangul shaping bugs. + +xdvipdfmx: +* Speed up calculating glyph widths in native font. + +* Don’t crash when /tmp is full. + +============================================================== +XeTeX 0.9999.0 was released 20130311 +============================================================== + +* Port OpenType layout from ICU LayoutEngine to HarfBuzz. + HarfBuzz is actively maintained and generally have much wider support for + OpenType spec, the switch fixes a number of OpenType bugs: + - Support version 2 OpenType Indic specs. + - Many other Indic OpenType bugs, and support for the latest additions to + OpenType spec. + - Incorrect application of contextual features. + - Incorrect kerning in fonts that has both old “kern” table and new GPOS + “kern” feature. + - Allow suppressing Latin ligatures with ZWNJ. + - Support for variation selectors. + - Support for user-specified features with complex scripts. + +* Port Graphite layout to from SilGraphite to HarfBuzz and Graphite2. Which + provides a more robust Graphite support and also fixes a number of Graphite + bugs. + +* Port AAT font layout and font searching on Mac from the deprecated ATS/ATSUI + to Core Text, and image support on Mac from QuickTime to ImageIO framework. + XeTeX can be finally built on 64-bit Mac! Work contributed by Jiang Jiang. + +* Add “/OT” font variant, similar to “/ICU” which is now deprecated. + +* Add a “shaper” font option to specify HarfBuzz shapers (for testing). + +* Guessed script from input string if no one is given in the font definition, + instead of defaulting to Latin. + +* Support 4-letter tags for Graphite features. + +* Use \U prefix for extended math primitives, allowing XeTeX and LuaTeX to use + the same names for Unicode math primitives supported by both engines. The old + \XeTeX* primitives have been deprecated and will be removed in the future. + +* Support OpenType math cut ins. + +* Fix “\show” and “\meaning” of “\Umathchar” to a print a form that is legal + input. + +* Fix italic correction to not depend on space factor being zero for OpenType + fonts. + +* Fix sporadic shifting of extensible accents. + +* Fix typesetting XeTeX’s WEB code, in addition to various slight improvements. + +* Prefer TrueType/OpenType over Type1 fonts with the same font name. + +* Support input pipes, in line with other engines. + +* Drop support for using “()” as font names quotes since it was causing file + names with parenthesis not to be found. + +* Fix “\show” with characters outside BMP. + +* Print the actual character instead of hex code for characters outside BMP + with “\show”, “\meaning”, “\showlists” and missing char log messages. + +* Fix letterspacing if zero width glyphs. + +* Try to get cap and x height from OS/2 table first. + +* Reject bitmap only fonts. + +* Include build date in “--version” output. + +============================================================== +XeTeX 0.9998 was released 20120708 +============================================================== + +* Fix mismatch between fonts loaded by XeTeX and xdvipdfmx when multiple + versions of the font exist. + +* Fix “\the\textfont” with families > 15 + +* Extend “\fam” to accept family number up to 255. + +* Fix build on Mac OS 10.7 + +OpenType math: + +* Fix displacement of big operator's limits when “DisplayOperatorMinHeight” is + higher than the size of the big operator. + +* Fix too wide accents over accentees that has sub/superscript. + +* Support extensible accents for “\overbrace” etc. + +* Always take math constants from current font, fixes multiple math discrepancies. + +* Honor relevant math constants when positioning sub/superscripts. + +* Honor “AccentBaseHeight” when placing accents. + +* Support “fixed” and “bottom” keywords in “\XeTeXmathaccent” for non growing + and bottom accents, respectively. + +* Fix horizontal placement of of accents over single letters to honor their top + accent position value. + +* Fix vertical placement of sub/superscripts of single letters to not be + treated as non-single letters. + +* Support proper positioning of nested accents. diff --git a/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp b/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp index 48e03015407..53f595d6555 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp +++ b/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp @@ -205,7 +205,7 @@ XeTeXFontMgr::findFont(const char* name, char* variant, double ptSize) sReqEngine = 0; bool reqBold = false; bool reqItal = false; - if (font != NULL && variant != NULL) { + if (variant != NULL) { std::string varString; char* cp = variant; while (*cp) { diff --git a/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp b/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp index e785f94e2d1..7744eead793 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp +++ b/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp @@ -46,8 +46,8 @@ struct XeTeXLayoutEngine_rec { XeTeXFontInst* font; PlatformFontRef fontRef; - char* script; - char* language; + hb_tag_t script; + hb_tag_t language; hb_feature_t* features; char** ShaperList; // the requested shapers char* shaper; // the actually used shaper @@ -417,13 +417,8 @@ getGraphiteFeatureDefaultSetting(XeTeXLayoutEngine engine, uint32_t featureID) gr_face* grFace = hb_graphite2_face_get_gr_face(hbFace); if (grFace != NULL) { - hb_tag_t lang = HB_TAG_NONE; - - if (engine->language != NULL) - lang = hb_tag_from_string(engine->language, -1); - const gr_feature_ref* feature = gr_face_find_fref(grFace, featureID); - gr_feature_val *featureValues = gr_face_featureval_for_lang (grFace, lang); + gr_feature_val *featureValues = gr_face_featureval_for_lang (grFace, engine->language); rval = gr_fref_feature_value(feature, featureValues); } @@ -601,7 +596,7 @@ getEmboldenFactor(XeTeXLayoutEngine engine) } XeTeXLayoutEngine -createLayoutEngine(PlatformFontRef fontRef, XeTeXFont font, char* script, char* language, +createLayoutEngine(PlatformFontRef fontRef, XeTeXFont font, hb_tag_t script, hb_tag_t language, hb_feature_t* features, int nFeatures, char **shapers, uint32_t rgbValue, float extend, float slant, float embolden) { @@ -648,11 +643,8 @@ layoutChars(XeTeXLayoutEngine engine, uint16_t chars[], int32_t offset, int32_t else if (rightToLeft) direction = HB_DIRECTION_RTL; - if (engine->script != NULL) - script = hb_script_from_string(engine->script, -1); - - if (engine->language != NULL) - language = hb_language_from_string(engine->language, -1); + script = hb_ot_tag_to_script (engine->script); + language = hb_ot_tag_to_language (engine->language); hb_buffer_reset(engine->hbBuffer); hb_buffer_add_utf16(engine->hbBuffer, chars, max, offset, count); @@ -885,15 +877,7 @@ initGraphiteBreaking(XeTeXLayoutEngine engine, const uint16_t* txtPtr, int txtLe grPrevSlot = NULL; } - hb_tag_t script = HB_TAG_NONE, lang = HB_TAG_NONE; - - if (engine->script != NULL) - script = hb_tag_from_string(engine->script, -1); - - if (engine->language != NULL) - lang = hb_tag_from_string(engine->language, -1); - - gr_feature_val *grFeatureValues = gr_face_featureval_for_lang (grFace, lang); + gr_feature_val *grFeatureValues = gr_face_featureval_for_lang (grFace, engine->language); int nFeatures = engine->nFeatures; hb_feature_t *features = engine->features; @@ -904,7 +888,7 @@ initGraphiteBreaking(XeTeXLayoutEngine engine, const uint16_t* txtPtr, int txtLe features++; } - grSegment = gr_make_seg(grFont, grFace, script, grFeatureValues, gr_utf16, txtPtr, txtLen, 0); + grSegment = gr_make_seg(grFont, grFace, engine->script, grFeatureValues, gr_utf16, txtPtr, txtLen, 0); grPrevSlot = gr_seg_first_slot(grSegment); grTextLen = txtLen; diff --git a/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.h b/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.h index 245bcd2e4ad..05240e69efc 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.h +++ b/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.h @@ -101,7 +101,7 @@ uint32_t getIndFeature(XeTeXFont font, uint32_t script, uint32_t language, uint3 float getGlyphWidth(XeTeXFont font, uint32_t gid); uint32_t countGlyphs(XeTeXFont font); -XeTeXLayoutEngine createLayoutEngine(PlatformFontRef fontRef, XeTeXFont font, char* script, char* language, +XeTeXLayoutEngine createLayoutEngine(PlatformFontRef fontRef, XeTeXFont font, hb_tag_t script, hb_tag_t language, hb_feature_t* features, int nFeatures, char **shapers, uint32_t rgbValue, float extend, float slant, float embolden); diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c index 70b9a3feaf5..e5e9ca3bfb8 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c +++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c @@ -568,7 +568,7 @@ void printutf8str(const unsigned char* str, int len) { while (len-- > 0) - printvisiblechar(*(str++)); /* bypass utf-8 encoding done in print_char() */ + printrawchar(*(str++), true); /* bypass utf-8 encoding done in print_char() */ } void @@ -875,32 +875,12 @@ readFeatureNumber(const char* s, const char* e, hb_tag_t* f, int* v) return true; } -#if !defined(HAVE_STRNDUP) -/* Inspired by the GNU C Library 2.3.6 - * Copyright (C) 1996, 1997, 1998, 2001, 2002 Free Software Foundation, Inc. - */ -static char *strndup (const char *str, size_t n) -{ - const char *p = (const char *) memchr(str, 0, n); - size_t len = p ? p - str : n; /* strnlen(str, n) */ - char *ret = (char *) malloc (len + 1); - - if (ret == NULL) - return NULL; - - ret[len] = '\0'; - return (char *) memcpy (ret, str, len); -} -#elif !(defined HAVE_DECL_STRNDUP && HAVE_DECL_STRNDUP) -char *strndup (const char *str, size_t n); -#endif - static void* loadOTfont(PlatformFontRef fontRef, XeTeXFont font, Fixed scaled_size, const char* cp1) { XeTeXLayoutEngine engine; - char* script = NULL; - char* language = NULL; + hb_tag_t script = HB_TAG_NONE; + hb_tag_t language = HB_TAG_NONE; hb_feature_t* features = NULL; char** shapers = NULL; /* NULL-terminated array */ int nFeatures = 0; @@ -961,7 +941,7 @@ loadOTfont(PlatformFontRef fontRef, XeTeXFont font, Fixed scaled_size, const cha if (*cp3 != '=') goto bad_option; ++cp3; - script = strndup(cp3, cp2 - cp3); + script = hb_tag_from_string(cp3, cp2 - cp3); goto next_option; } @@ -970,7 +950,7 @@ loadOTfont(PlatformFontRef fontRef, XeTeXFont font, Fixed scaled_size, const cha if (*cp3 != '=') goto bad_option; ++cp3; - language = strndup(cp3, cp2 - cp3); + language = hb_tag_from_string(cp3, cp2 - cp3); goto next_option; } @@ -980,7 +960,9 @@ loadOTfont(PlatformFontRef fontRef, XeTeXFont font, Fixed scaled_size, const cha goto bad_option; ++cp3; shapers = xrealloc(shapers, (nShapers + 1) * sizeof(char *)); - shapers[nShapers] = strndup(cp3, cp2 - cp3); + /* some dumb systems have no strndup() */ + shapers[nShapers] = strdup(cp3); + shapers[nShapers][cp2 - cp3] = '\0'; nShapers++; goto next_option; } @@ -1148,7 +1130,7 @@ findnativefont(unsigned char* uname, integer scaled_size) char* varString = NULL; char* featString = NULL; PlatformFontRef fontRef; - XeTeXFont font; + XeTeXFont font = NULL; int index = 0; loadedfontmapping = NULL; @@ -1246,31 +1228,32 @@ findnativefont(unsigned char* uname, integer scaled_size) } } -#ifdef XETEX_MAC - /* decide whether to use AAT or OpenType rendering with this font */ - if (getReqEngine() == 'A') - goto load_aat; -#endif - font = createFont(fontRef, scaled_size); if (font != NULL) { #ifdef XETEX_MAC - if (getReqEngine() == 'O' || getReqEngine() == 'G' || - getFontTablePtr(font, kGSUB) != NULL || getFontTablePtr(font, kGPOS) != NULL) -#endif - rval = loadOTfont(fontRef, font, scaled_size, featString); - if (rval == NULL) - deleteFont(font); - } - -#ifdef XETEX_MAC - if (rval == NULL) { -load_aat: - if (font != NULL) { + /* decide whether to use AAT or OpenType rendering with this font */ + if (getReqEngine() == 'A') { rval = loadAATfont(fontRef, scaled_size, featString); + if (rval == NULL) + deleteFont(font); + } else { + if (getReqEngine() == 'O' || getReqEngine() == 'G' || + getFontTablePtr(font, kGSUB) != NULL || getFontTablePtr(font, kGPOS) != NULL) + rval = loadOTfont(fontRef, font, scaled_size, featString); + + /* loadOTfont failed or the above check was false */ + if (rval == NULL) + rval = loadAATfont(fontRef, scaled_size, featString); + + if (rval == NULL) + deleteFont(font); } - } +#else + rval = loadOTfont(fontRef, font, scaled_size, featString); + if (rval == NULL) + deleteFont(font); #endif + } /* append the style and feature strings, so that \show\fontID will give a full result */ if (varString != NULL && *varString != 0) { @@ -2087,7 +2070,7 @@ measure_native_node(void* pNode, int use_glyph_metrics) native_glyph_count(node) = totalGlyphCount; native_glyph_info_ptr(node) = glyph_info; } else { - int i; + double width = 0; totalGlyphCount = layoutChars(engine, txtPtr, 0, txtLen, txtLen, (dir == UBIDI_RTL)); glyphs = xmalloc(totalGlyphCount * sizeof(uint32_t)); @@ -2099,6 +2082,7 @@ measure_native_node(void* pNode, int use_glyph_metrics) getGlyphPositions(engine, positions); if (totalGlyphCount > 0) { + int i; glyph_info = xmalloc(totalGlyphCount * native_glyph_info_size); locations = (FixedPoint*)glyph_info; glyphIDs = (uint16_t*)(locations + totalGlyphCount); @@ -2109,9 +2093,10 @@ measure_native_node(void* pNode, int use_glyph_metrics) locations[i].x = D2Fix(positions[2*i]); locations[i].y = D2Fix(positions[2*i+1]); } + width = D2Fix(positions[2*i]); } - node_width(node) = D2Fix(positions[2*i]); + node_width(node) = width; native_glyph_count(node) = totalGlyphCount; native_glyph_info_ptr(node) = glyph_info; diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_mac.c b/Build/source/texk/web2c/xetexdir/XeTeX_mac.c index dc495b14648..44a45692d4b 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_mac.c +++ b/Build/source/texk/web2c/xetexdir/XeTeX_mac.c @@ -428,7 +428,7 @@ getFileNameFromCTFont(CTFontRef ctFontRef, int *index) } } - error = FT_New_Face(gFreeTypeLibrary, pathname, 0, &face); + error = FT_New_Face(gFreeTypeLibrary, (char *) pathname, 0, &face); if (!error) { if (face->num_faces > 1) { int num_faces = face->num_faces; @@ -437,7 +437,7 @@ getFileNameFromCTFont(CTFontRef ctFontRef, int *index) *index = -1; FT_Done_Face (face); for (i = 0; i < num_faces; i++) { - error = FT_New_Face (gFreeTypeLibrary, pathname, i, &face); + error = FT_New_Face (gFreeTypeLibrary, (char *) pathname, i, &face); if (!error) { const char *ps_name2 = FT_Get_Postscript_Name(face); if (strcmp(ps_name1, ps_name2) == 0) { @@ -451,7 +451,7 @@ getFileNameFromCTFont(CTFontRef ctFontRef, int *index) } if (*index != -1) - ret = strdup(pathname); + ret = strdup((char *) pathname); } CFRelease(url); } @@ -490,7 +490,7 @@ findDictionaryInArray(CFArrayRef array, const void* nameKey, const char* name, i if (array) { CFStringRef itemName; CFIndex i; - itemName = CFStringCreateWithBytes(NULL, name, nameLength, + itemName = CFStringCreateWithBytes(NULL, (UInt8 *) name, nameLength, kCFStringEncodingUTF8, false); for (i = 0; i < CFArrayGetCount(array); i++) { CFDictionaryRef item = CFArrayGetValueAtIndex(array, i); diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_pic.c b/Build/source/texk/web2c/xetexdir/XeTeX_pic.c index a4ae4724da1..ff4266be280 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_pic.c +++ b/Build/source/texk/web2c/xetexdir/XeTeX_pic.c @@ -49,9 +49,9 @@ XeTeX_pic.c #include <kpathsea/absolute.h> #include "pdfimage.h" -#include "pngimage.h" -#include "jpegimage.h" -#include "bmpimage.h" +#include "image/pngimage.h" +#include "image/jpegimage.h" +#include "image/bmpimage.h" int diff --git a/Build/source/texk/web2c/xetexdir/am/xetex.am b/Build/source/texk/web2c/xetexdir/am/xetex.am index 9fca6871091..d468800f86b 100644 --- a/Build/source/texk/web2c/xetexdir/am/xetex.am +++ b/Build/source/texk/web2c/xetexdir/am/xetex.am @@ -153,14 +153,18 @@ libxetex_a_SOURCES += \ xetexdir/XeTeXFontMgr_FC.cpp \ xetexdir/XeTeXFontMgr_FC.h \ xetexdir/XeTeX_pic.c \ - xetexdir/bmpimage.c \ - xetexdir/bmpimage.h \ - xetexdir/jpegimage.c \ - xetexdir/jpegimage.h \ xetexdir/pdfimage.cpp \ xetexdir/pdfimage.h \ - xetexdir/pngimage.c \ - xetexdir/pngimage.h + xetexdir/image/bmpimage.c \ + xetexdir/image/bmpimage.h \ + xetexdir/image/jpegimage.c \ + xetexdir/image/jpegimage.h \ + xetexdir/image/mfileio.c \ + xetexdir/image/mfileio.h \ + xetexdir/image/numbers.c \ + xetexdir/image/numbers.h \ + xetexdir/image/pngimage.c \ + xetexdir/image/pngimage.h endif !XETEX_MACOSX diff --git a/Build/source/texk/web2c/xetexdir/image/README b/Build/source/texk/web2c/xetexdir/image/README new file mode 100644 index 00000000000..744d2fa2ef4 --- /dev/null +++ b/Build/source/texk/web2c/xetexdir/image/README @@ -0,0 +1 @@ +The files in this directory are derived from DVIPDFMx project diff --git a/Build/source/texk/web2c/xetexdir/bmpimage.c b/Build/source/texk/web2c/xetexdir/image/bmpimage.c index 27310327e36..27310327e36 100644 --- a/Build/source/texk/web2c/xetexdir/bmpimage.c +++ b/Build/source/texk/web2c/xetexdir/image/bmpimage.c diff --git a/Build/source/texk/web2c/xetexdir/bmpimage.h b/Build/source/texk/web2c/xetexdir/image/bmpimage.h index 1f5cacd00bd..cef4f8b27ad 100644 --- a/Build/source/texk/web2c/xetexdir/bmpimage.h +++ b/Build/source/texk/web2c/xetexdir/image/bmpimage.h @@ -54,6 +54,8 @@ #include <w2c/config.h> #endif +#include "mfileio.h" + struct bmp_info { int width; int height; diff --git a/Build/source/texk/web2c/xetexdir/jpegimage.c b/Build/source/texk/web2c/xetexdir/image/jpegimage.c index 491a49656ae..e35844785eb 100644 --- a/Build/source/texk/web2c/xetexdir/jpegimage.c +++ b/Build/source/texk/web2c/xetexdir/image/jpegimage.c @@ -75,6 +75,9 @@ * Level 2. */ +#include "mfileio.h" +#include "numbers.h" + #include "jpegimage.h" #include <stdlib.h> @@ -97,30 +100,6 @@ static void JPEG_info_clear (struct JPEG_info *j_info); #define NEW(n, t) (t*)xmalloc(n * sizeof(t)) #define RENEW(p, n, t) ((p) ? (t*)xrealloc(p, (n) * sizeof(t)) : NEW(n, t)) -static int -get_unsigned_byte (FILE *file) -{ - int ch; - if ((ch = fgetc (file)) < 0) { - fprintf (stderr, "File ended prematurely\n"); - exit(-1); - } - return ch; -} - -static unsigned -get_unsigned_pair (FILE *file) -{ - int i; - int byte; - unsigned pair = 0; - for (i=0; i<2; i++) { - byte = get_unsigned_byte(file); - pair = pair*0x100u + byte; - } - return pair; -} - int check_for_jpeg (FILE *fp) { @@ -143,8 +122,8 @@ JPEG_info_init (struct JPEG_info *j_info) j_info->bits_per_component = 0; j_info->num_components = 0; - j_info->xdpi = 0; - j_info->ydpi = 0; + j_info->xdpi = 72.0; + j_info->ydpi = 72.0; j_info->flags = 0; j_info->num_appn = 0; @@ -444,7 +423,7 @@ read_APP0_JFXX (struct JPEG_info *j_info, FILE *fp, unsigned short length) * 0x11: Thumbnail stored using 1 byte/pixel * 0x13: Thumbnail stored using 3 bytes/pixel */ - fseek(fp, length-1, SEEK_CUR); /* Thunbnail image */ + seek_relative(fp, length-1); /* Thunbnail image */ /* Ignore */ @@ -513,7 +492,7 @@ JPEG_scan_file (struct JPEG_info *j_info, FILE *fp) length -= read_APP0_JFXX(j_info, fp, length); } } - fseek(fp, length, SEEK_CUR); + seek_relative(fp, length); break; case JM_APP1: if (length > 5) { @@ -524,7 +503,7 @@ JPEG_scan_file (struct JPEG_info *j_info, FILE *fp) length -= read_APP1_Exif(j_info, fp, length); } } - fseek(fp, length, SEEK_CUR); + seek_relative(fp, length); break; case JM_APP2: if (length >= 14) { @@ -539,7 +518,7 @@ JPEG_scan_file (struct JPEG_info *j_info, FILE *fp) } } } - fseek(fp, length, SEEK_CUR); + seek_relative(fp, length); break; case JM_APP14: if (length > 5) { @@ -555,10 +534,10 @@ JPEG_scan_file (struct JPEG_info *j_info, FILE *fp) } } } - fseek(fp, length, SEEK_CUR); + seek_relative(fp, length); break; default: - fseek(fp, length, SEEK_CUR); + seek_relative(fp, length); if (marker >= JM_APP0 && marker <= JM_APP15) { if (count < MAX_COUNT) { diff --git a/Build/source/texk/web2c/xetexdir/jpegimage.h b/Build/source/texk/web2c/xetexdir/image/jpegimage.h index 690acabe133..432cef96546 100644 --- a/Build/source/texk/web2c/xetexdir/jpegimage.h +++ b/Build/source/texk/web2c/xetexdir/image/jpegimage.h @@ -49,7 +49,7 @@ #ifndef _JPEGIMAGE_H_ #define _JPEGIMAGE_H_ -#include <stdio.h> +#include "mfileio.h" /* JPEG Markers */ typedef enum { diff --git a/Build/source/texk/web2c/xetexdir/image/mfileio.c b/Build/source/texk/web2c/xetexdir/image/mfileio.c new file mode 100644 index 00000000000..e6c1a229850 --- /dev/null +++ b/Build/source/texk/web2c/xetexdir/image/mfileio.c @@ -0,0 +1,126 @@ +/* $Header: /home/cvsroot/dvipdfmx/src/mfileio.c,v 1.3 2002/10/30 02:27:11 chofchof Exp $ + + This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. + + Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata, + the dvipdfmx project team <dvipdfmx@project.ktug.or.kr> + + Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + +#include <stdio.h> +#include <stdlib.h> +#include "mfileio.h" + +#ifdef IODEBUG +static FILE *iodebug_file = NULL; +static long event = 0; +static void io_debug_init(void) +{ + if (!iodebug_file) { + iodebug_file = fopen ("fopen.log", "wb"); + fprintf (stderr, "\n*** File IO debugging started ***\n"); + } + if (!iodebug_file) { + fprintf (stderr, "\nError opening io log\n"); + } +} +#endif + +#ifdef IODEBUG +FILE *mfopen(const char *name, const char *mode, const char *function, int line) +{ + FILE *tmp; + io_debug_init(); + tmp = fopen (name, mode); + event += 1; + fprintf(iodebug_file, "%p %07ld [fopen] %s:%d\n", tmp, event, + function, line); + return tmp; +} +int mfclose(FILE *file, const char *function, int line) +{ + io_debug_init(); + event += 1; + fprintf(iodebug_file, "%p %07ld [fclose] %s:%d\n", file, event, + function, line); + return fclose(file); +} +#endif + +static void os_error() +{ + fprintf (stderr, "io: An OS command failed that should not have.\n"); + exit(-1); +} + +void seek_absolute (FILE *file, long pos) +{ + if (fseek(file, pos, SEEK_SET)) { + os_error(); + } +} + +void seek_relative (FILE *file, long pos) +{ + if (fseek(file, pos, SEEK_CUR)) { + os_error(); + } +} + + +void seek_end (FILE *file) +{ + if (fseek(file, 0L, SEEK_END)) { + os_error(); + } +} + +long tell_position (FILE *file) +{ + long size; + if ((size = ftell (file)) < 0) { + os_error(); + } + return size; +} + +long file_size (FILE *file) +{ + long size; + /* Seek to end */ + seek_end (file); + size = tell_position (file); + rewind (file); + return (size); +} + +/* Unlike fgets, mfgets works with \r, \n, or \r\n end of lines. */ +char *mfgets (char *buffer, unsigned long length, FILE *file) +{ + int ch = 0, i = 0; + while (i < length-1 && (ch = fgetc (file)) >= 0 && ch != '\n' && ch != '\r') + buffer[i++] = ch; + buffer[i] = 0; + if (ch < 0 && i == 0) + return NULL; + if (ch == '\r' && (ch = fgetc (file)) >= 0 && (ch != '\n')) + ungetc (ch, file); + return buffer; +} + +char work_buffer[WORK_BUFFER_SIZE]; diff --git a/Build/source/texk/web2c/xetexdir/image/mfileio.h b/Build/source/texk/web2c/xetexdir/image/mfileio.h new file mode 100644 index 00000000000..e31fef23244 --- /dev/null +++ b/Build/source/texk/web2c/xetexdir/image/mfileio.h @@ -0,0 +1,61 @@ +/* $Header: /home/cvsroot/dvipdfmx/src/mfileio.h,v 1.3 2002/10/30 02:27:12 chofchof Exp $ + + This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. + + Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata, + the dvipdfmx project team <dvipdfmx@project.ktug.or.kr> + + Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + +#ifndef _MFILEIO_H_ +#define _MFILEIO_H_ + +#include <stdio.h> +#include "numbers.h" + +#ifdef IODEBUG +FILE *mfopen (const char *name, const char *mode, + const char *function, int line); +int mfclose (FILE *file, const char *function, int line); +#define MFOPEN(name,mode) \ + mfopen((name),(mode),__FUNCTION__,__LINE__) +#define MFCLOSE(file) \ + mfclose((file),__FUNCTION__,__LINE__) +#else +#define MFOPEN(name,mode) fopen((name),(mode)) +#define MFCLOSE(file) fclose(file) +#endif + +extern UNSIGNED_BYTE read_byte (FILE *); + +extern void seek_absolute (FILE *file, long pos); +extern void seek_relative (FILE *file, long pos); + +extern void seek_end (FILE *file); + +extern long tell_position (FILE *file); + +extern long file_size (FILE *file); + +extern char *mfgets (char *buffer, unsigned long size, FILE *file); + +extern char work_buffer[]; + +#define WORK_BUFFER_SIZE 1024 + +#endif /* _MFILEIO_H_ */ diff --git a/Build/source/texk/web2c/xetexdir/image/numbers.c b/Build/source/texk/web2c/xetexdir/image/numbers.c new file mode 100644 index 00000000000..06864f1e2bb --- /dev/null +++ b/Build/source/texk/web2c/xetexdir/image/numbers.c @@ -0,0 +1,227 @@ +/* $Header: /home/cvsroot/dvipdfmx/src/numbers.c,v 1.8 2004/03/03 13:19:00 hirata Exp $ + + This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. + + Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata, + the dvipdfmx project team <dvipdfmx@project.ktug.or.kr> + + Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + +#include <stdlib.h> + +#include "mfileio.h" +#include "numbers.h" + +UNSIGNED_BYTE get_unsigned_byte (FILE *file) +{ + int ch; + if ((ch = fgetc (file)) < 0) { + fprintf (stderr, "File ended prematurely\n"); + exit(-1); + } + return (UNSIGNED_BYTE) ch; +} + +UNSIGNED_BYTE sget_unsigned_byte (char *s) +{ + return *((unsigned char *) s); +} + +SIGNED_BYTE get_signed_byte (FILE *file) +{ + int byte; + byte = get_unsigned_byte(file); + if (byte >= 0x80) + byte -= 0x100; + return (SIGNED_BYTE) byte; +} + +UNSIGNED_PAIR get_unsigned_pair (FILE *file) +{ + int i; + UNSIGNED_BYTE byte; + UNSIGNED_PAIR pair = 0; + for (i=0; i<2; i++) { + byte = get_unsigned_byte(file); + pair = pair*0x100u + byte; + } + return pair; +} + +UNSIGNED_PAIR sget_unsigned_pair (unsigned char *s) +{ + int i; + UNSIGNED_BYTE byte; + UNSIGNED_PAIR pair = 0; + for (i=0; i<2; i++) { + byte = *(s++); + pair = pair*0x100u + byte; + } + return pair; +} + +SIGNED_PAIR get_signed_pair (FILE *file) +{ + int i; + long pair = 0; + for (i=0; i<2; i++) { + pair = pair*0x100 + get_unsigned_byte(file); + } + if (pair >= 0x8000) { + pair -= 0x10000l; + } + return (SIGNED_PAIR) pair; +} + + +UNSIGNED_TRIPLE get_unsigned_triple(FILE *file) +{ + int i; + long triple = 0; + for (i=0; i<3; i++) { + triple = triple*0x100u + get_unsigned_byte(file); + } + return (UNSIGNED_TRIPLE) triple; +} + +SIGNED_TRIPLE get_signed_triple(FILE *file) +{ + int i; + long triple = 0; + for (i=0; i<3; i++) { + triple = triple*0x100 + get_unsigned_byte(file); + } + if (triple >= 0x800000l) + triple -= 0x1000000l; + return (SIGNED_TRIPLE) triple; +} + +SIGNED_QUAD get_signed_quad(FILE *file) +{ + int byte, i; + long quad = 0; + + /* Check sign on first byte before reading others */ + byte = get_unsigned_byte(file); + quad = byte; + if (quad >= 0x80) + quad = byte - 0x100; + for (i=0; i<3; i++) { + quad = quad*0x100 + get_unsigned_byte(file); + } + return (SIGNED_QUAD) quad; +} + +UNSIGNED_QUAD get_unsigned_quad(FILE *file) +{ + int i; + unsigned long quad = 0; + for (i=0; i<4; i++) { + quad = quad*0x100u + get_unsigned_byte(file); + } + return (UNSIGNED_QUAD) quad; +} + +#if 0 +SIGNED_QUAD sqxfw (SIGNED_QUAD sq, fixword fw) +{ + int sign = 1; + unsigned long a, b, c, d, ad, bd, bc, ac; + unsigned long e, f, g, h, i, j, k; + unsigned long result; + /* Make positive. */ + if (sq < 0) { + sign = -sign; + sq = -sq; + } + if (fw < 0) { + sign = -sign; + fw = -fw; + } + a = ((unsigned long) sq) >> 16u; + b = ((unsigned long) sq) & 0xffffu; + c = ((unsigned long) fw) >> 16u; + d = ((unsigned long) fw) & 0xffffu; + ad = a*d; bd = b*d; bc = b*c; ac = a*c; + e = bd >> 16u; + f = ad >> 16u; + g = ad & 0xffffu; + h = bc >> 16u; + i = bc & 0xffffu; + j = ac >> 16u; + k = ac & 0xffffu; + result = (e+g+i + (1<<3)) >> 4u; /* 1<<3 is for rounding */ + result += (f+h+k) << 12u; + result += j << 28u; + return (sign > 0) ? result : result * -1L; +} + +SIGNED_QUAD axboverc (SIGNED_QUAD n1, SIGNED_QUAD n2, SIGNED_QUAD divide) +{ + int sign = 1; + unsigned long a, b, c, d, ad, bd, bc, ac, e, f, g, h, i, j, o; + unsigned long high, low; + SIGNED_QUAD result = 0; + /* Make positive. */ + if (n1 < 0) { + sign = -sign; + n1 = -n1; + } + if (n2 < 0) { + sign = -sign; + n2 = -n2; + } + if (divide < 0) { + sign = -sign; + divide = -divide; + } + a = ((unsigned long) n1) >> 16u; + b = ((unsigned long) n1) & 0xffffu; + c = ((unsigned long) n2) >> 16u; + d = ((unsigned long) n2) & 0xffffu; + ad = a*d; bd = b*d; bc = b*c; ac = a*c; + e = bd >> 16u; f = bd & 0xffffu; + g = ad >> 16u; h = ad & 0xffffu; + i = bc >> 16u; j = bc & 0xffffu; + o = e+h+j; + high = g+i+(o>>16u)+ac; o &= 0xffffu; + low = (o << 16) + f; + if (high >= divide) + ERROR ("Overflow in axboc"); + { + int k; + for (k=0; k<32; k++) { + high *= 2; + result *= 2; + if (low >= 0x80000000) { + low -= 0x80000000; + high += 1; + } + low *= 2; + if (high > divide) { + high -= divide; + result += 1; + } + } + } + high *= 2; + if (high >= divide) + result += 1; + return (sign>0)?result:-result; +} +#endif diff --git a/Build/source/texk/web2c/xetexdir/image/numbers.h b/Build/source/texk/web2c/xetexdir/image/numbers.h new file mode 100644 index 00000000000..1f61607654e --- /dev/null +++ b/Build/source/texk/web2c/xetexdir/image/numbers.h @@ -0,0 +1,78 @@ +/* $Header: /home/cvsroot/dvipdfmx/src/numbers.h,v 1.9 2005/07/20 10:41:54 hirata Exp $ + + This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. + + Copyright (C) 2002, 2012 by Jin-Hwan Cho and Shunsaku Hirata, + the dvipdfmx project team <dvipdfmx@project.ktug.or.kr> + + Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + +#ifndef _NUMBERS_H_ +#define _NUMBERS_H_ + +#include <stdio.h> +#include <math.h> + +typedef unsigned char Ubyte; +typedef int UNSIGNED_BYTE, SIGNED_BYTE, SIGNED_PAIR; +typedef unsigned UNSIGNED_PAIR; +typedef long UNSIGNED_TRIPLE, SIGNED_TRIPLE, SIGNED_QUAD; +typedef unsigned long UNSIGNED_QUAD; + +extern UNSIGNED_BYTE get_unsigned_byte (FILE *); +extern UNSIGNED_BYTE sget_unsigned_byte (char *); +extern SIGNED_BYTE get_signed_byte (FILE *); +extern UNSIGNED_PAIR get_unsigned_pair (FILE *); +extern UNSIGNED_PAIR sget_unsigned_pair (unsigned char *); +extern SIGNED_PAIR get_signed_pair (FILE *); +extern UNSIGNED_TRIPLE get_unsigned_triple (FILE *); +extern SIGNED_TRIPLE get_signed_triple (FILE *); +extern SIGNED_QUAD get_signed_quad (FILE *); +extern UNSIGNED_QUAD get_unsigned_quad (FILE *); + +typedef signed long fixword; + +extern SIGNED_QUAD sqxfw (SIGNED_QUAD sq, fixword fw); +extern SIGNED_QUAD axboverc (SIGNED_QUAD n1, SIGNED_QUAD n2, SIGNED_QUAD divide); + +#ifndef MAX +# define MAX(a,b) ((a)>(b)?(a):(b)) +#endif +#ifndef MIN +# define MIN(a,b) ((a)<(b)?(a):(b)) +#endif +#define ISODD(n) (((n)/2)*2!=(n)) +#define ISEVEN(n) (((n)/2)*2==(n)) + +#define ROUND(n,acc) (floor(((double)n)/(acc)+0.5)*(acc)) + +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# define __C99__ +#endif + +#ifndef __C99__ +# ifndef round +# define round(v) (floor((v) + 0.5)) +# endif +# ifndef trunc +# define trunc(v) ((v) > 0.0 ? floor((v)) : ceil((v))) +# endif +#endif +#define round_at(v,acc) (round(((double)(v))/(acc))*(acc)) + +#endif /* _NUMBERS_H_ */ diff --git a/Build/source/texk/web2c/xetexdir/pngimage.c b/Build/source/texk/web2c/xetexdir/image/pngimage.c index 42279345881..42279345881 100644 --- a/Build/source/texk/web2c/xetexdir/pngimage.c +++ b/Build/source/texk/web2c/xetexdir/image/pngimage.c diff --git a/Build/source/texk/web2c/xetexdir/pngimage.h b/Build/source/texk/web2c/xetexdir/image/pngimage.h index bda409dc7d5..a908244da08 100644 --- a/Build/source/texk/web2c/xetexdir/pngimage.h +++ b/Build/source/texk/web2c/xetexdir/image/pngimage.h @@ -54,6 +54,8 @@ #include <w2c/config.h> #endif +#include "mfileio.h" + struct png_info { int width; int height; diff --git a/Build/source/texk/web2c/xetexdir/xetex.web b/Build/source/texk/web2c/xetexdir/xetex.web index ec150978603..fef28971141 100644 --- a/Build/source/texk/web2c/xetexdir/xetex.web +++ b/Build/source/texk/web2c/xetexdir/xetex.web @@ -1,7 +1,7 @@ % Copyright (c) 1994-2008 by SIL International % Copyright (c) 2009-2012 by Jonathan Kew -% Copyright (c) 2010-2012 Han Han The Thanh -% Copyright (c) 2012 by Khaled Hosny +% Copyright (c) 2010-2012 by Han Han The Thanh +% Copyright (c) 2012-2013 by Khaled Hosny % SIL Author(s): Jonathan Kew @@ -319,7 +319,7 @@ known as `\eTeX'. @# @d XeTeX_version=0 { \.{\\XeTeXversion} } @d XeTeX_revision==".9999" { \.{\\XeTeXrevision} } -@d XeTeX_version_string=='-0.9999.0' {current \XeTeX\ version} +@d XeTeX_version_string=='-0.9999.1' {current \XeTeX\ version} @# @d XeTeX_banner=='This is XeTeX, Version 3.1415926',eTeX_version_string,XeTeX_version_string {printed when \XeTeX\ starts} @@ -742,7 +742,7 @@ system libraries. @<Types...@>= @!ASCII_code=0..biggest_char; {16-bit numbers} @!UTF8_code=0..255; {8-bit numbers} -@!UnicodeScalar=0..@"10FFFF; {Unicode scalars} +@!UnicodeScalar=0..biggest_usv; {Unicode scalars} @ The original \PASCAL\ compiler was designed in the late 60s, when six-bit character sets were common, so it did not make provision for lowercase @@ -794,9 +794,6 @@ hand, it is possible to implement \TeX\ with less complete character sets, and in such cases it will be necessary to change something here. @^system dependencies@> -@<Set init...@>= -{ don't need to set up xchr here } - @ Some of the ASCII codes without visible characters have been given symbolic names in this program because they are used with a special meaning. @@ -1243,7 +1240,7 @@ we access the string pool only via macros that can easily be redefined. @<Types...@>= @!pool_pointer = 0..pool_size; {for variables that point into |str_pool|} @!str_number = 0..max_strings; {for variables that point into |str_start|} -@!packed_ASCII_code = 0..65535; {elements of |str_pool| array} +@!packed_ASCII_code = 0..biggest_char; {elements of |str_pool| array} @ @<Glob...@>= @!str_pool:packed array[pool_pointer] of packed_ASCII_code; {the characters} @@ -1614,17 +1611,22 @@ othercases write_ln(write_file[selector]) endcases;@/ end; {|tally| is not affected} -@ The |print_char| procedure sends one character to the desired destination, +@ The |print_raw_char| procedure sends one character to the desired destination, using the |xchr| array to map it into an external character compatible with -|input_ln|. All printing comes through |print_ln| or |print_char|. +|input_ln|. All printing comes through |print_ln|, |print_char| or +|print_visible_char|. When printing a multi-byte character, the boolean +parameter |incr_offset| is set |false| except for the very last byte, to avoid +calling |print_ln| in the middle of such character. @<Basic printing...@>= -procedure print_visible_char(@!s:ASCII_code); {prints a single character} +procedure print_raw_char(@!s:ASCII_code;@!incr_offset:boolean); {prints a single character} label exit; {label is not used but nonetheless kept (for other changes?)} begin case selector of term_and_log: begin wterm(xchr[s]); wlog(xchr[s]); - incr(term_offset); incr(file_offset); + if incr_offset then + begin incr(term_offset); incr(file_offset); + end; if term_offset=max_print_line then begin wterm_cr; term_offset:=0; end; @@ -1632,10 +1634,12 @@ term_and_log: begin wterm(xchr[s]); wlog(xchr[s]); begin wlog_cr; file_offset:=0; end; end; -log_only: begin wlog(xchr[s]); incr(file_offset); +log_only: begin wlog(xchr[s]); + if incr_offset then incr(file_offset); if file_offset=max_print_line then print_ln; end; -term_only: begin wterm(xchr[s]); incr(term_offset); +term_only: begin wterm(xchr[s]); + if incr_offset then incr(term_offset); if term_offset=max_print_line then print_ln; end; no_print: do_nothing; @@ -1650,12 +1654,13 @@ exit:end; @ The |print_char| procedure sends one character to the desired destination. Control sequence names, file names and string constructed with \.{\\string} might contain |ASCII_code| values that can't -be printed using |print_visible_char|. These characters will be printed +be printed using |print_raw_char|. These characters will be printed in three- or four-symbol form like `\.{\^\^A}' or `\.{\^\^e4}', unless the -8bit option is enabled. Output that goes to the terminal and/or log file is treated differently when it comes to determining whether a character is printable. +@d print_visible_char(#)==print_raw_char(#, true) @d print_lc_hex(#)==l:=#; if l<10 then print_visible_char(l+"0")@+else print_visible_char(l-10+"a") @@ -1694,18 +1699,18 @@ end else if (s < @"A0) and (eight_bit_p = 0) and (not doing_special) then {C1 co end else begin { |char >= 128|: encode as UTF8 } if s<@"800 then begin - print_visible_char(@"C0 + s div @"40); - print_visible_char(@"80 + s mod @"40); + print_raw_char(@"C0 + s div @"40, false); + print_raw_char(@"80 + s mod @"40, true); end else if s<@"10000 then begin - print_visible_char(@"E0 + (s div @"1000)); - print_visible_char(@"80 + (s mod @"1000) div @"40); - print_visible_char(@"80 + (s mod @"40)); + print_raw_char(@"E0 + (s div @"1000), false); + print_raw_char(@"80 + (s mod @"1000) div @"40, false); + print_raw_char(@"80 + (s mod @"40), true); end else begin - print_visible_char(@"F0 + (s div @"40000)); - print_visible_char(@"80 + (s mod @"40000) div @"1000); - print_visible_char(@"80 + (s mod @"1000) div @"40); - print_visible_char(@"80 + (s mod @"40)); + print_raw_char(@"F0 + (s div @"40000), false); + print_raw_char(@"80 + (s mod @"40000) div @"1000, false); + print_raw_char(@"80 + (s mod @"1000) div @"40, false); + print_raw_char(@"80 + (s mod @"40), true); end end; exit:end; @@ -9802,8 +9807,8 @@ end; @ @<Declare procedures that scan restricted classes of integers@>= procedure scan_usv_num; begin scan_int; -if (cur_val<0)or(cur_val>@"10FFFF) then - begin print_err("Bad USV code"); +if (cur_val<0)or(cur_val>biggest_usv) then + begin print_err("Bad character code"); @.Bad character code@> help2("A Unicode Scalar Value must be between 0 and ""10FFFF.")@/ ("I changed this one to zero."); int_error(cur_val); cur_val:=0; @@ -9833,7 +9838,7 @@ begin scan_int; ("I changed this one to ""1FFFFF."); int_error(cur_val); cur_val := active_math_char; end - end else if math_char_field(cur_val) > @"10FFFF then begin + end else if math_char_field(cur_val)>biggest_usv then begin print_err("Bad XeTeX math character code"); help2("Since I expected a character number between 0 and ""10FFFF,")@/ ("I changed this one to zero."); int_error(cur_val); cur_val:=0; diff --git a/Build/source/texk/web2c/xetexdir/xetex_version.h b/Build/source/texk/web2c/xetexdir/xetex_version.h index 4b5964d8633..ba8ab21dd6f 100644 --- a/Build/source/texk/web2c/xetexdir/xetex_version.h +++ b/Build/source/texk/web2c/xetexdir/xetex_version.h @@ -1 +1 @@ -#define XETEX_VERSION "0.9999.0" +#define XETEX_VERSION "0.9999.1" diff --git a/Build/source/texk/web2c/xetexdir/xewebmac.tex b/Build/source/texk/web2c/xetexdir/xewebmac.tex index 771d58df240..3770b4bafbb 100644 --- a/Build/source/texk/web2c/xetexdir/xewebmac.tex +++ b/Build/source/texk/web2c/xetexdir/xewebmac.tex @@ -3,63 +3,8 @@ % pdfTeX adjustments mainained by Han The Thanh <hanthethanh@gmx.net>. % XeTeX adjustments mainited by Khaled Hosny <khaledhosny@eglug.org> % -\xdef\fmtversion{\fmtversion+WEBMAC4.1} % identifies current set of macros -\parskip 0pt % no stretch between paragraphs -\parindent 1em % for paragraphs and for the first line of Pascal text -\font\eightrm=cmr8 \let\sc=\eightrm % NOT a caps-and-small-caps font! -\let\mainfont=\tenrm -\font\titlefont=cmr7 scaled\magstep4 % title on the contents page -\font\ttitlefont=cmtt10 scaled\magstep2 % typewriter type in title -\font\tentex=cmtex10 % TeX extended character set (used in strings) -\fontdimen7\tentex=0pt % no extra space after punctuation - -\def\\#1{\hbox{\it#1\/\kern.05em}} % italic type for identifiers -\def\|#1{\hbox{$#1$}} % one-letter identifiers look a bit better this way -\def\{\hbox{\bf#1\/}} % boldface type for reserved words -\def\.#1{\hbox{\tentex % typewriter type for strings - \let\\=\BS % backslash in a string - \let\'=\RQ % right quote in a string - \let\`=\LQ % left quote in a string - \let\{=\LB % left brace in a string - \let\}=\RB % right brace in a string - \let\~=\TL % tilde in a string - \let\ =\SP % space in a string - \let\_=\UL % underline in a string - \let\&=\AM % ampersand in a string - #1}} -\def\#{\hbox{\tt\char`\#}} % parameter sign -\def\${\hbox{\tt\char`\$}} % dollar sign -\def\%{\hbox{\tt\char`\%}} % percent sign -\def\^{\ifmmode\mathchar"222 \else\char`^ \fi} % pointer or hat -% circumflex accents can be obtained from \^^D instead of \^ -\def\AT!{@} % at sign for control text - -\chardef\AM=`\& % ampersand character in a string -\chardef\BS=`\\ % backslash in a string -\chardef\LB=`\{ % left brace in a string -\def\LQ{{\tt\char'22}} % left quote in a string -\chardef\RB=`\} % right brace in a string -\def\RQ{{\tt\char'23}} % right quote in a string -\def\SP{{\tt\char`\ }} % (visible) space in a string -\chardef\TL=`\~ % tilde in a string -\chardef\UL=`\_ % underline character in a string - -\newbox\bak \setbox\bak=\hbox to -1em{} % backspace one em -\newbox\bakk\setbox\bakk=\hbox to -2em{} % backspace two ems - -\newcount\ind % current indentation in ems -\def\1{\global\advance\ind by1\hangindent\ind em} % indent one more notch -\def\2{\global\advance\ind by-1} % indent one less notch -\def\3#1{\hfil\penalty#10\hfilneg} % optional break within a statement -\def\4{\copy\bak} % backspace one notch -\def\5{\hfil\penalty-1\hfilneg\kern2.5em\copy\bakk\ignorespaces}% optional break -\def\6{\ifmmode\else\par % forced break - \hangindent\ind em\noindent\kern\ind em\copy\bakk\ignorespaces\fi} -\def\7{\Y\6} % forced break and a little extra space - -\let\yskip=\smallskip -\def\to{\mathrel{.\,.}} % double dot, used only in math mode +\ifdefined\botofcontents\else\input webmac.tex\fi % Some changes for xetex \def\note#1#2.{\Y\noindent{\hangindent2em\baselineskip10pt\eightrm#1~\pdfnote#2..\par}} @@ -98,105 +43,11 @@ {\noexpand\n{\the\toksC}}\toksC={}\global\countA=0} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} -\def\lapstar{\rlap{*}} \def\startsection{\Q{\let\*=\empty\special{pdf:dest (\modstar) [@thispage /XYZ @xpos @ypos null]}}% \noindent{\let\*=\lapstar\bf\modstar.\quad}} -\def\defin#1{\global\advance\ind by 2 \1\&{#1 }} % begin `define' or `format' -\def\A{\note{See also section}} % crossref for doubly defined section name -\def\As{\note{See also sections}} % crossref for multiply defined section name -\def\B{\mathopen{\.{@\{}}} % begin controlled comment -\def\C#1{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi % Pascal comments - \XX\hfil\penalty-1\hfilneg\quad$\{\,$#1$\,\}$\XX} -\def\D{\defin{define}} % macro definition -\def\E{\cdot10^} % exponent in floating point constant -\def\ET{ and~} % conjunction between two section numbers -\def\ETs{, and~} % conjunction between the last two of several section numbers -\def\F{\defin{format}} % format definition -\let\G=\ge % greater than or equal sign -\def\H#1{\hbox{\rm\char"7D\tt#1}} % hexadecimal constant -\let\I=\ne % unequal sign -\def\J{\.{@\&}} % TANGLE's join operation -\let\K=\gets % left arrow -\let\L=\le % less than or equal sign -\outer\def\M#1.{\MN#1.\ifon\vfil\penalty-100\vfilneg % beginning of section - \vskip12ptminus3pt\startsection\ignorespaces} -\outer\def\N#1.#2.{\MN#1.\vfil\eject % beginning of starred section - \def\rhead{\uppercase{\ignorespaces#2}} % define running headline - \message{*\modno} % progress report - \edef\next{\write\cont{\Z{#2}{\modno}{\the\pageno}}}\next % to contents file - \ifon\startsection{\bf\ignorespaces#2.\quad}\ignorespaces} -\def\MN#1.{\par % common code for \M, \N - {\xdef\modstar{#1}\let\*=\empty\xdef\modno{#1}} - \ifx\modno\modstar \onmaybe \else\ontrue \fi \mark{\modno}} -\def\O#1{\hbox{\rm\char'23\kern-.2em\it#1\/\kern.05em}} % octal constant -\def\P{\rightskip=0pt plus 100pt minus 10pt % go into Pascal mode - \sfcode`;=3000 - \pretolerance 10000 - \hyphenpenalty 10000 \exhyphenpenalty 10000 - \global\ind=2 \1\ \unskip} -\def\Q{\rightskip=0pt % get out of Pascal mode - \sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50 } -\let\R=\lnot % logical not -\let\S=\equiv % equivalence sign -\def\T{\mathclose{\.{@\}}}} % terminate controlled comment -\def\U{\note{This code is used in section}} % crossref for use of a section -\def\Us{\note{This code is used in sections}} % crossref for uses of a section -\let\V=\lor % logical or -\let\W=\land % logical and + \def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi % section name \XX$\langle\,$#2{\eightrm\kern.5em\pdfnote#1.}$\,\rangle$\XX} -\def\Y{\par\yskip} -\let\Z=\let % now you can \send the control sequence \Z -\def\){\hbox{\.{@\$}}} % sign for string pool check sum -\def\]{\hbox{\.{@\\}}} % sign for forced line break -\def\=#1{\kern2pt\hbox{\vrule\vtop{\vbox{\hrule - \hbox{\strut\kern2pt\.{#1}\kern2pt}} - \hrule}\vrule}\kern2pt} % verbatim string -\let\~=\ignorespaces -\let\*=* - -\def\onmaybe{\let\ifon=\maybe} \let\maybe=\iftrue -\newif\ifon \newif\iftitle \newif\ifpagesaved -\def\lheader{\mainfont\the\pageno\eightrm\qquad\rhead\hfill\title\qquad - \tensy x\mainfont\topmark} % top line on left-hand pages -\def\rheader{\tensy x\mainfont\topmark\eightrm\qquad\title\hfill\rhead - \qquad\mainfont\the\pageno} % top line on right-hand pages -\def\page{\box255 } -\def\normaloutput#1#2#3{\ifodd\pageno\hoffset=\pageshift\fi - \shipout\vbox{ - \vbox to\fullpageheight{ - \iftitle\global\titlefalse - \else\hbox to\pagewidth{\vbox to10pt{}\ifodd\pageno #3\else#2\fi}\fi - \vfill#1}} % parameter #1 is the page itself - \global\advance\pageno by1} - -\def\rhead{\.{WEB} OUTPUT} % this running head is reset by starred sections -\def\title{} % an optional title can be set by the user -\def\topofcontents{\centerline{\titlefont\title} - \vfill} % this material will start the table of contents page -\def\botofcontents{\vfill} % this material will end the table of contents page -\def\contentspagenumber{0} % default page number for table of contents -\newdimen\pagewidth \pagewidth=6.5in % the width of each page -\newdimen\pageheight \pageheight=8.7in % the height of each page -\newdimen\fullpageheight \fullpageheight=9in % page height including headlines -\newdimen\pageshift \pageshift=0in % shift righthand pages wrt lefthand ones -\def\magnify#1{\mag=#1\pagewidth=6.5truein\pageheight=8.7truein - \fullpageheight=9truein\setpage} -\def\setpage{\hsize\pagewidth\vsize\pageheight} % use after changing page size -\def\contentsfile{CONTENTS} % file that gets table of contents info -\def\readcontents{\input CONTENTS} - -\newwrite\cont -\output{\setbox0=\page % the first page is garbage - \openout\cont=\contentsfile - \global\output{\normaloutput\page\lheader\rheader}} -\setpage -\vbox to \vsize{} % the first \topmark won't be null - -\def\ch{\note{The following sections were changed by the change file:} - \let\*=\relax} -\newbox\sbox % saved box preceding the index -\newbox\lbox % lefthand column in the index \def\inx{\par\vskip6pt plus 1fil % we are beginning the index \write\cont{} % ensure that the contents file isn't empty \closeout\cont % the contents information has been fully gathered |