summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/xetexdir/XeTeX_ext.c
diff options
context:
space:
mode:
authorJonathan Kew <jfkthame@googlemail.com>2009-06-28 15:08:34 +0000
committerJonathan Kew <jfkthame@googlemail.com>2009-06-28 15:08:34 +0000
commit08a53bdd859aa65607e861717aefe482d4e25e01 (patch)
tree734ad7d83921ba8bfc75bb353726b8d88d218767 /Build/source/texk/web2c/xetexdir/XeTeX_ext.c
parenta99482a8c7776d3e8fad84c918f05c49f896bca5 (diff)
xetex 0.9995.0
git-svn-id: svn://tug.org/texlive/trunk@13982 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/xetexdir/XeTeX_ext.c')
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeX_ext.c72
1 files changed, 52 insertions, 20 deletions
diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c
index a6b55929882..4fbb13986db 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c
+++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c
@@ -1,31 +1,33 @@
/****************************************************************************\
Part of the XeTeX typesetting system
- copyright (c) 1994-2006 by SIL International
- written by Jonathan Kew
-
-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
+ copyright (c) 1994-2008 by SIL International
+ copyright (c) 2009 by Jonathan Kew
+
+ Written by Jonathan Kew
+
+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
+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
+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 THE COPYRIGHT HOLDERS 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.
+Except as contained in this notice, the name of the copyright holders
+shall not be used in advertising or otherwise to promote the sale,
+use or other dealings in this Software without prior written
+authorization from the copyright holders.
\****************************************************************************/
/* XeTeX_ext.c
@@ -2046,6 +2048,36 @@ getnativecharsidebearings(integer font, integer ch, scaled* lsb, scaled* rsb)
}
scaled
+getglyphbounds(integer font, integer edge, integer gid)
+{
+/* edge codes 1,2,3,4 => L T R B */
+ float a, b;
+
+#ifdef XETEX_MAC
+ if (fontarea[font] == AAT_FONT_FLAG) {
+ ATSUStyle style = (ATSUStyle)(fontlayoutengine[font]);
+ if (edge & 1)
+ GetGlyphSidebearings_AAT(style, gid, &a, &b);
+ else
+ GetGlyphHeightDepth_AAT(style, gid, &a, &b);
+ }
+ else
+#endif
+ if (fontarea[font] == OTGR_FONT_FLAG) {
+ XeTeXLayoutEngine engine = (XeTeXLayoutEngine)fontlayoutengine[font];
+ if (edge & 1)
+ getGlyphSidebearings(engine, gid, &a, &b);
+ else
+ getGlyphHeightDepth(engine, gid, &a, &b);
+ }
+ else {
+ fprintf(stderr, "\n! Internal error: bad native font flag\n");
+ exit(3);
+ }
+ return X2Fix((edge <= 2) ? a : b);
+}
+
+scaled
getnativecharic(integer f, integer c)
{
scaled lsb, rsb;