projects
/
m17n
/
m17n-lib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle the case of _M17N_FLT_H_ being defined.
[m17n/m17n-lib.git]
/
src
/
face.c
diff --git
a/src/face.c
b/src/face.c
index
dace53a
..
983228c
100644
(file)
--- a/
src/face.c
+++ b/
src/face.c
@@
-702,15
+702,15
@@
mface__realize (MFrame *frame, MFace **faces, int num, int size, MFont *font)
font);
rfont = NULL;
mfont__set_spec_from_face (&spec, &merged_face);
font);
rfont = NULL;
mfont__set_spec_from_face (&spec, &merged_face);
- mfont_put_prop (&spec, Mregistry, Miso8859_1);
- spec.source = MFONT_SOURCE_X;
+ mfont_put_prop (&spec, Mregistry, Municode_bmp);
+ spec.source = MFONT_SOURCE_FT;
font = mfont__select (frame, &spec, 0);
if (font)
rfont = mfont__open (frame, font, &spec);
if (! rfont)
{
font = mfont__select (frame, &spec, 0);
if (font)
rfont = mfont__open (frame, font, &spec);
if (! rfont)
{
- mfont_put_prop (&spec, Mregistry, Municode_bmp);
- spec.source = MFONT_SOURCE_FT;
+ mfont_put_prop (&spec, Mregistry, Miso8859_1);
+ spec.source = MFONT_SOURCE_X;
font = mfont__select (frame, &spec, 0);
if (font)
rfont = mfont__open (frame, font, &spec);
font = mfont__select (frame, &spec, 0);
if (font)
rfont = mfont__open (frame, font, &spec);
@@
-729,29
+729,32
@@
mface__realize (MFrame *frame, MFace **faces, int num, int size, MFont *font)
rface->layouter = rfont->layouter;
rfont->layouter = Mnil;
work_gstring.glyphs[0].rface = rface;
rface->layouter = rfont->layouter;
rfont->layouter = Mnil;
work_gstring.glyphs[0].rface = rface;
- work_gstring.glyphs[0].code = MCHAR_INVALID_CODE;
+ work_gstring.glyphs[0].g.code = MCHAR_INVALID_CODE;
+ work_gstring.glyphs[0].g.measured = 0;
mfont__get_metric (&work_gstring, 0, 1);
mfont__get_metric (&work_gstring, 0, 1);
- rface->ascent = work_gstring.glyphs[0].ascent;
- rface->descent = work_gstring.glyphs[0].descent;
- work_gstring.glyphs[0].code
+ rface->ascent = work_gstring.glyphs[0].g.ascent;
+ rface->descent = work_gstring.glyphs[0].g.descent;
+ work_gstring.glyphs[0].g.code
= mfont__encode_char (frame, (MFont *) rfont, NULL, ' ');
= mfont__encode_char (frame, (MFont *) rfont, NULL, ' ');
- if (work_gstring.glyphs[0].code != MCHAR_INVALID_CODE)
+ if (work_gstring.glyphs[0].g.code != MCHAR_INVALID_CODE)
{
{
+ work_gstring.glyphs[0].g.measured = 0;
mfont__get_metric (&work_gstring, 0, 1);
mfont__get_metric (&work_gstring, 0, 1);
- rface->space_width = work_gstring.glyphs[0].width;
+ rface->space_width = work_gstring.glyphs[0].g.xadv;
}
else
rface->space_width = rfont->spec.size / 10;
if (rfont->average_width)
}
else
rface->space_width = rfont->spec.size / 10;
if (rfont->average_width)
- rface->average_width = rfont->average_width;
+ rface->average_width = rfont->average_width >> 6;
else
{
else
{
- work_gstring.glyphs[0].code
+ work_gstring.glyphs[0].g.code
= mfont__encode_char (frame, (MFont *) rfont, NULL, 'x');
= mfont__encode_char (frame, (MFont *) rfont, NULL, 'x');
- if (work_gstring.glyphs[0].code != MCHAR_INVALID_CODE)
+ if (work_gstring.glyphs[0].g.code != MCHAR_INVALID_CODE)
{
{
+ work_gstring.glyphs[0].g.measured = 0;
mfont__get_metric (&work_gstring, 0, 1);
mfont__get_metric (&work_gstring, 0, 1);
- rface->average_width = work_gstring.glyphs[0].width;
+ rface->average_width = work_gstring.glyphs[0].g.xadv;
}
else
rface->average_width = rface->space_width;
}
else
rface->average_width = rface->space_width;
@@
-818,7
+821,7
@@
mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
if (! rfont)
{
for (; from_g < to_g && from_g->rface->font; from_g++)
if (! rfont)
{
for (; from_g < to_g && from_g->rface->font; from_g++)
- from_g->code = MCHAR_INVALID_CODE;
+ from_g->g.code = MCHAR_INVALID_CODE;
}
else
{
}
else
{
@@
-833,28
+836,33
@@
mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
new->layouter = rfont->layouter;
rfont->layouter = Mnil;
new->non_ascii_list = NULL;
new->layouter = rfont->layouter;
rfont->layouter = Mnil;
new->non_ascii_list = NULL;
- new->ascent = rfont->ascent;
- new->descent = rfont->descent;
+ new->ascent = rfont->ascent >> 6;
+ new->descent = rfont->descent >> 6;
}
for (; from_g < to_g && from_g->rface->font; from_g++)
{
from_g->rface = new;
if (new->layouter)
{
}
for (; from_g < to_g && from_g->rface->font; from_g++)
{
from_g->rface = new;
if (new->layouter)
{
- from_g->code = mfont__flt_encode_char (new->layouter,
- from_g->c);
- if (from_g->code == MCHAR_INVALID_CODE)
+ MFLT *flt = mflt_get (new->layouter);
+ MCharTable *coverage;
+
+ if (! flt
+ || ((coverage = mflt_coverage (flt))
+ && ! (from_g->g.code
+ = (unsigned) mchartable_lookup (coverage,
+ from_g->g.c))))
{
from_g->rface = rface;
{
from_g->rface = rface;
- from_g->code = mfont__encode_char (rfont->frame,
- (MFont *) rfont,
- NULL, from_g->c);
+ from_g->g.code = mfont__encode_char (rfont->frame,
+ (MFont *) rfont,
+ NULL, from_g->g.c);
}
}
else
}
}
else
- from_g->code = mfont__encode_char (rfont->frame,
- (MFont *) rfont,
- NULL, from_g->c);
+ from_g->g.code = mfont__encode_char (rfont->frame,
+ (MFont *) rfont,
+ NULL, from_g->g.c);
}
}
return from_g;
}
}
return from_g;
@@
-865,10
+873,10
@@
mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
for (i = 0; i < num; i++)
{
unsigned code = mfont__encode_char (rfont->frame, (MFont *) rfont,
for (i = 0; i < num; i++)
{
unsigned code = mfont__encode_char (rfont->frame, (MFont *) rfont,
- NULL, from_g[i].c);
+ NULL, from_g[i].g.c);
if (code == MCHAR_INVALID_CODE)
break;
if (code == MCHAR_INVALID_CODE)
break;
- from_g[i].code = code;
+ from_g[i].g.code = code;
}
if (i == num || from_g[i].rface->font)
return from_g + i;
}
if (i == num || from_g[i].rface->font)
return from_g + i;
@@
-883,7
+891,7
@@
mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
}
else
{
}
else
{
- from_g->code = MCHAR_INVALID_CODE;
+ from_g->g.code = MCHAR_INVALID_CODE;
num = 1;
rfont = NULL;
layouter = Mnil;
num = 1;
rfont = NULL;
layouter = Mnil;
@@
-919,8
+927,8
@@
mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
new->non_ascii_list = NULL;
if (rfont)
{
new->non_ascii_list = NULL;
if (rfont)
{
- new->ascent = rfont->ascent;
- new->descent = rfont->descent;
+ new->ascent = rfont->ascent >> 6;
+ new->descent = rfont->descent >> 6;
}
}
while (g < from_g)
}
}
while (g < from_g)
@@
-1855,9
+1863,14
@@
mface_get_prop (MFace *face, MSymbol key)
/***en
@brief Get the hook function of a face.
/***en
@brief Get the hook function of a face.
- The mface_get_hook () function returns a hook function of face
+ The mface_get_hook () function returns the hook function of face
$FACE. */
$FACE. */
+/***ja
+ @brief ¥Õ¥§¡¼¥¹¤Î¥Õ¥Ã¥¯´Ø¿ô¤òÆÀ¤ë.
+
+ ´Ø¿ô mface_get_hook () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤Î¥Õ¥Ã¥¯´Ø¿ô¤òÊÖ¤¹¡£ */
+
MFaceHookFunc
mface_get_hook (MFace *face)
{
MFaceHookFunc
mface_get_hook (MFace *face)
{
@@
-1968,6
+1981,12
@@
mface_put_prop (MFace *face, MSymbol key, void *val)
The mface_set_hook () function sets the hook function of face
$FACE to $FUNC. */
The mface_set_hook () function sets the hook function of face
$FACE to $FUNC. */
+/***ja
+ @brief ¥Õ¥§¡¼¥¹¤Î¥Õ¥Ã¥¯´Ø¿ô¤òÀßÄꤹ¤ë.
+
+ ´Ø¿ô mface_set_hook () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE ¤Î¥Õ¥Ã¥¯´Ø¿ô¤ò$FUNC ¤ËÀß
+ Äꤹ¤ë¡£ */
+
int
mface_put_hook (MFace *face, MFaceHookFunc func)
{
int
mface_put_hook (MFace *face, MFaceHookFunc func)
{