[gs-cvs] rev 9101 - trunk/ghostpdl/pl
henrys at ghostscript.com
henrys at ghostscript.com
Thu Sep 18 14:36:36 PDT 2008
Author: henrys
Date: 2008-09-18 14:36:36 -0700 (Thu, 18 Sep 2008)
New Revision: 9101
Modified:
trunk/ghostpdl/pl/plchar.c
trunk/ghostpdl/pl/plfont.h
trunk/ghostpdl/pl/pluchar.c
Log:
Factor out repeated code from the ufst character module to the common
character module. By inspection no output changes are anticipated.
Modified: trunk/ghostpdl/pl/plchar.c
===================================================================
--- trunk/ghostpdl/pl/plchar.c 2008-09-18 20:32:08 UTC (rev 9100)
+++ trunk/ghostpdl/pl/plchar.c 2008-09-18 21:36:36 UTC (rev 9101)
@@ -470,7 +470,7 @@
/* Look up a character in the TrueType character-to-TT-glyph map. */
/* Return a pointer to the glyph's slot (chr != gs_no_char) or where */
/* it should be added (chr == gs_no_char). */
-static pl_tt_char_glyph_t *
+pl_tt_char_glyph_t *
pl_tt_lookup_char(const pl_font_t *plfont, gs_glyph glyph)
{ uint size = plfont->char_glyphs.size;
uint skip = plfont->char_glyphs.skip;
Modified: trunk/ghostpdl/pl/plfont.h
===================================================================
--- trunk/ghostpdl/pl/plfont.h 2008-09-18 20:32:08 UTC (rev 9100)
+++ trunk/ghostpdl/pl/plfont.h 2008-09-18 21:36:36 UTC (rev 9101)
@@ -287,11 +287,15 @@
lsb and metrics 2 = width. The same rules for character width apply */
int pl_font_char_metrics(const pl_font_t *plfont, const void *pgs, uint char_code, float metrics[4]);
+
/* Look up a glyph in a font. Return a pointer to the glyph's slot */
/* (data != 0) or where it should be added (data == 0). */
pl_font_glyph_t *pl_font_lookup_glyph(const pl_font_t *plfont,
gs_glyph glyph);
+/* Look up a truetype character */
+pl_tt_char_glyph_t *pl_tt_lookup_char(const pl_font_t *plfont, gs_glyph glyph);
+
/* Determine whether a font, with a given symbol set, includes a given */
/* character. If the font is bound, the symbol set is ignored. */
#define pl_font_includes_char(plfont, maps, matrix, char_code)\
Modified: trunk/ghostpdl/pl/pluchar.c
===================================================================
--- trunk/ghostpdl/pl/pluchar.c 2008-09-18 20:32:08 UTC (rev 9100)
+++ trunk/ghostpdl/pl/pluchar.c 2008-09-18 21:36:36 UTC (rev 9101)
@@ -418,77 +418,6 @@
}
-/* ---------------- TrueType font support ---------------- */
-
-/* Look up a character in the TrueType character-to-TT-glyph map. */
-/* Return a pointer to the glyph's slot (chr != gs_no_char) or where */
-/* it should be added (chr == gs_no_char). */
-static pl_tt_char_glyph_t *
-pl_tt_lookup_char(const pl_font_t *plfont, gs_glyph glyph)
-{ uint size = plfont->char_glyphs.size;
- uint skip = plfont->char_glyphs.skip;
- uint index = glyph % size;
- pl_tt_char_glyph_t *ptcg;
- pl_tt_char_glyph_t *result = 0;
-
- while ( (ptcg = plfont->char_glyphs.table + index)->chr != gs_no_char ?
- ptcg->chr != glyph : ptcg->glyph
- )
- { if ( ptcg->chr == gs_no_char )
- result = ptcg;
- index = (index >= skip ? index : index + size) - skip;
- }
- return (result ? result : ptcg);
-}
-
-/* Get a string from a TrueType font. */
-static int
-pl_tt_string_proc(gs_font_type42 *pfont, ulong offset, uint length,
- const byte **pdata)
-{ pl_font_t *plfont = pfont->client_data;
-
- *pdata = plfont->header + plfont->offsets.GT +
- (plfont->large_sizes ? 6 : 4) + offset;
- return 0;
-}
-
-/* Return the vertical substitute for a glyph, if it has one; */
-/* otherwise return gs_no_glyph. */
-static gs_glyph
-pl_font_vertical_glyph(gs_glyph glyph, const pl_font_t *plfont)
-{ long VT = plfont->offsets.VT;
- const byte *vtseg;
- uint i, len;
-
- if ( VT < 0 )
- return gs_no_glyph;
- vtseg = plfont->header + VT;
- if ( plfont->large_sizes )
- len = pl_get_uint32(vtseg + 2),
- i = 6;
- else
- len = pl_get_uint16(vtseg + 2),
- i = 4;
- len += i;
- for ( ; i < len; i += 4 )
- if ( glyph == pl_get_uint16(vtseg + i) )
- return pl_get_uint16(vtseg + i + 2);
- return gs_no_glyph;
-}
-#define access(base, length, vptr)\
- (*pfont->data.string_proc)(pfont, (ulong)(base), length, &vptr)
-
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
-#endif
-
-/* Opaque type for a path */
-#ifndef gx_path_DEFINED
-# define gx_path_DEFINED
-typedef struct gx_path_s gx_path;
-#endif
-
/* ---------------- MicroType font support ---------------- */
/*
* MicroType accepts unicode values a glyph identifiers, so no explicit
More information about the gs-cvs
mailing list