projects
/
m17n
/
m17n-test.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6b138cd
)
*** empty log message ***
author
handa
<handa>
Sun, 16 Sep 2007 11:01:04 +0000
(11:01 +0000)
committer
handa
<handa>
Sun, 16 Sep 2007 11:01:04 +0000
(11:01 +0000)
find-flt.c
patch
|
blob
|
history
flt.c
patch
|
blob
|
history
diff --git
a/find-flt.c
b/find-flt.c
index
7c67c9d
..
c256d12
100644
(file)
--- a/
find-flt.c
+++ b/
find-flt.c
@@
-12,27
+12,19
@@
otf_tag (char *p)
return (i < 4 ? 0 : tag);
}
return (i < 4 ? 0 : tag);
}
-
-
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- MFLTGlyphString gstring;
- MFLTGlyph g;
+ int c;
MFLT *flt;
M17N_INIT ();
MFLT *flt;
M17N_INIT ();
- gstring.glyph_size = sizeof (MFLTGlyph);
- gstring.glyphs = &g;
- gstring.allocated = gstring.used = 1;
- gstring.script = otf_tag ("deva");
- gstring.langsys = 0;
-
- g.c = 0x915;
- flt = mflt_find (&gstring, 0, NULL, NULL);
+ c = 0x915;
+ flt = mflt_find (c, NULL);
if (! flt)
exit (1);
if (! flt)
exit (1);
+ printf ("%s\n", mflt_name (flt));
M17N_FINI ();
exit (0);
}
M17N_FINI ();
exit (0);
}
diff --git
a/flt.c
b/flt.c
index
70e6abe
..
5756bd3
100644
(file)
--- a/
flt.c
+++ b/
flt.c
@@
-119,7
+119,7
@@
struct _MFLTFont
{
int x_ppem, y_ppem;
void (*get_glyph_id) (void);
{
int x_ppem, y_ppem;
void (*get_glyph_id) (void);
- void (*get_metric) (void);
+ void (*get_metrics) (void);
void (*suitable_p) (void);
void (*drive_otf) (void);
MFont *font;
void (*suitable_p) (void);
void (*drive_otf) (void);
MFont *font;
@@
-127,7
+127,7
@@
struct _MFLTFont
};
void get_glyph_id (void) {}
};
void get_glyph_id (void) {}
-void get_metric (void) {}
+void get_metrics (void) {}
void suitable_p (void) {}
void drive_otf (void) {}
void suitable_p (void) {}
void drive_otf (void) {}
@@
-194,7
+194,7
@@
get_glyph_id (MFLTFont *font, MFLTGlyphString *gstring, int from, int to)
}
int
}
int
-get_metric (MFLTFont *font, MFLTGlyphString *gstring, int from, int to)
+get_metrics (MFLTFont *font, MFLTGlyphString *gstring, int from, int to)
{
FT_Face face = ((FontInfo *) font)->face;
{
FT_Face face = ((FontInfo *) font)->face;
@@
-384,7
+384,11
@@
drive_otf (MFLTFont *font, MFLTOtfSpec *spec,
g->c = in->glyphs[j].c;
break;
}
g->c = in->glyphs[j].c;
break;
}
- g->code = otfg->glyph_id;
+ if (g->code != otfg->glyph_id)
+ {
+ g->code = otfg->glyph_id;
+ g->measured = 0;
+ }
out->used++;
}
}
out->used++;
}
}
@@
-396,8
+400,6
@@
drive_otf (MFLTFont *font, MFLTOtfSpec *spec,
out->glyphs[out->used++] = in->glyphs[from + i];
}
out->glyphs[out->used++] = in->glyphs[from + i];
}
- font->get_metric (font, out, gidx, out->used);
-
if (gpos_features)
{
FT_Face face;
if (gpos_features)
{
FT_Face face;
@@
-502,7
+504,7
@@
drive_otf (MFLTFont *font, MFLTOtfSpec *spec,
return to;
simple_copy:
return to;
simple_copy:
- font->get_metric (font, in, from, to);
+ font->get_metrics (font, in, from, to);
for (i = 0; i < len; i++)
{
MFLTGlyph *g = in->glyphs + (from + i);
for (i = 0; i < len; i++)
{
MFLTGlyph *g = in->glyphs + (from + i);
@@
-912,7
+914,11
@@
drive_otf (MFLTFont *font, MFLTOtfSpec *spec,
out->glyphs[out->used] = in->glyphs[hg->cluster];
g = out->glyphs + out->used++;
if (g->code != hg->gindex)
out->glyphs[out->used] = in->glyphs[hg->cluster];
g = out->glyphs + out->used++;
if (g->code != hg->gindex)
- g->c = 0, g->code = hg->gindex;
+ {
+ g->c = 0;
+ g->code = hg->gindex;
+ g->measured = 0;
+ }
adjustment[i].set = gpos_applied;
if (gpos_applied)
{
adjustment[i].set = gpos_applied;
if (gpos_applied)
{
@@
-1029,7
+1035,7
@@
get_glyph_id (MFLTFont *font, MFLTGlyphString *gstring, int from, int to)
#define PANGO_SCALE_TO_26_6 (PANGO_SCALE / (1<<6))
int
#define PANGO_SCALE_TO_26_6 (PANGO_SCALE / (1<<6))
int
-get_metric (MFLTFont *font, MFLTGlyphString *gstring, int from, int to)
+get_metrics (MFLTFont *font, MFLTGlyphString *gstring, int from, int to)
{
FontInfoPango *font_info = (FontInfoPango *) font;
int i;
{
FontInfoPango *font_info = (FontInfoPango *) font;
int i;
@@
-1199,7
+1205,11
@@
drive_otf (MFLTFont *font, MFLTOtfSpec *spec,
out->glyphs[out->used] = in->glyphs[glyphs->log_clusters[i]];
g = out->glyphs + out->used++;
if (g->code != glyph_info->glyph)
out->glyphs[out->used] = in->glyphs[glyphs->log_clusters[i]];
g = out->glyphs + out->used++;
if (g->code != glyph_info->glyph)
- g->c = 0, g->code = glyph_info->glyph;
+ {
+ g->c = 0;
+ g->code = glyph_info->glyph;
+ g->measured = 0;
+ }
g->xoff = glyph_info->geometry.x_offset / PANGO_SCALE_TO_26_6;
g->yoff = glyph_info->geometry.y_offset / PANGO_SCALE_TO_26_6;
g->xadv = glyph_info->geometry.width / PANGO_SCALE_TO_26_6;
g->xoff = glyph_info->geometry.x_offset / PANGO_SCALE_TO_26_6;
g->yoff = glyph_info->geometry.y_offset / PANGO_SCALE_TO_26_6;
g->xadv = glyph_info->geometry.width / PANGO_SCALE_TO_26_6;
@@
-1366,7
+1376,7
@@
main (int argc, char **argv)
exit (1);
}
font->get_glyph_id = get_glyph_id;
exit (1);
}
font->get_glyph_id = get_glyph_id;
- font->get_metric = get_metric;
+ font->get_metrics = get_metrics;
font->drive_otf = drive_otf;
mt = mconv_decode_stream (msymbol ("utf-8"), stdin);
font->drive_otf = drive_otf;
mt = mconv_decode_stream (msymbol ("utf-8"), stdin);