Above left support. Various fixups
This commit is contained in:
parent
45511ee976
commit
7624beba47
2 changed files with 27 additions and 15 deletions
41
font/font.c
41
font/font.c
|
@ -1122,7 +1122,9 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
|
|||
struct grub_video_signed_rect bounds;
|
||||
unsigned i;
|
||||
signed above_rightx, above_righty;
|
||||
signed above_leftx, above_lefty;
|
||||
signed below_rightx, below_righty;
|
||||
signed min_devwidth = 0;
|
||||
auto void NESTED_FUNC_ATTR do_blit (struct grub_font_glyph *src,
|
||||
signed dx, signed dy);
|
||||
void NESTED_FUNC_ATTR do_blit (struct grub_font_glyph *src,
|
||||
|
@ -1147,14 +1149,6 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
|
|||
bounds.height = src->height + (-src->height - dy) - bounds.y;
|
||||
}
|
||||
|
||||
auto void minimal_device_width (int val);
|
||||
void minimal_device_width (int val)
|
||||
{
|
||||
if (glyph && glyph->device_width < val)
|
||||
glyph->device_width = val;
|
||||
if (device_width && *device_width < val)
|
||||
*device_width = val;
|
||||
}
|
||||
auto void add_device_width (int val);
|
||||
void add_device_width (int val)
|
||||
{
|
||||
|
@ -1174,9 +1168,12 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
|
|||
bounds.width = main_glyph->width;
|
||||
bounds.height = main_glyph->height;
|
||||
|
||||
above_rightx = bounds.x + bounds.width;
|
||||
above_rightx = main_glyph->offset_x + main_glyph->width;
|
||||
above_righty = bounds.y + bounds.height;
|
||||
|
||||
above_leftx = main_glyph->offset_x;
|
||||
above_lefty = bounds.y + bounds.height;
|
||||
|
||||
below_rightx = bounds.x + bounds.width;
|
||||
below_righty = bounds.y;
|
||||
|
||||
|
@ -1198,27 +1195,31 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
|
|||
centerx,
|
||||
(bounds.height - combining_glyphs[i]->height) / 2
|
||||
-(bounds.height + bounds.y));
|
||||
minimal_device_width (combining_glyphs[i]->width);
|
||||
if (min_devwidth < combining_glyphs[i]->width)
|
||||
min_devwidth = combining_glyphs[i]->width;
|
||||
break;
|
||||
|
||||
case GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT:
|
||||
do_blit (combining_glyphs[i], above_rightx, -above_righty);
|
||||
above_rightx += combining_glyphs[i]->width;
|
||||
minimal_device_width (above_rightx);
|
||||
break;
|
||||
|
||||
case GRUB_UNICODE_COMB_ABOVE_RIGHT:
|
||||
do_blit (combining_glyphs[i], above_rightx,
|
||||
-(above_righty + combining_glyphs[i]->height));
|
||||
above_rightx += combining_glyphs[i]->width;
|
||||
minimal_device_width (above_rightx);
|
||||
break;
|
||||
|
||||
case GRUB_UNICODE_COMB_ABOVE_LEFT:
|
||||
above_leftx -= combining_glyphs[i]->width;
|
||||
do_blit (combining_glyphs[i], above_leftx,
|
||||
-(above_lefty + combining_glyphs[i]->height));
|
||||
break;
|
||||
|
||||
case GRUB_UNICODE_COMB_BELOW_RIGHT:
|
||||
do_blit (combining_glyphs[i], below_rightx,
|
||||
below_righty);
|
||||
below_rightx += combining_glyphs[i]->width;
|
||||
minimal_device_width (below_rightx);
|
||||
break;
|
||||
|
||||
case GRUB_UNICODE_STACK_ABOVE:
|
||||
|
@ -1231,7 +1232,8 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
|
|||
do_blit (combining_glyphs[i], centerx,
|
||||
-(bounds.height + bounds.y + space
|
||||
+ combining_glyphs[i]->height));
|
||||
minimal_device_width (combining_glyphs[i]->width);
|
||||
if (min_devwidth < combining_glyphs[i]->width)
|
||||
min_devwidth = combining_glyphs[i]->width;
|
||||
break;
|
||||
|
||||
/* I don't know how ypogegrammeni differs from subscript. */
|
||||
|
@ -1245,7 +1247,8 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
|
|||
case GRUB_UNICODE_STACK_ATTACHED_BELOW:
|
||||
do_blit (combining_glyphs[i], centerx,
|
||||
-(bounds.y - space));
|
||||
minimal_device_width (combining_glyphs[i]->width);
|
||||
if (min_devwidth < combining_glyphs[i]->width)
|
||||
min_devwidth = combining_glyphs[i]->width;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1263,6 +1266,14 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
|
|||
}
|
||||
}
|
||||
}
|
||||
add_device_width ((above_rightx > below_rightx ? above_rightx : below_rightx)
|
||||
- (main_glyph->offset_x + main_glyph->width));
|
||||
add_device_width (above_leftx - main_glyph->offset_x);
|
||||
if (glyph && glyph->device_width < min_devwidth)
|
||||
glyph->device_width = min_devwidth;
|
||||
if (device_width && *device_width < min_devwidth)
|
||||
*device_width = min_devwidth;
|
||||
|
||||
if (bounds_out)
|
||||
*bounds_out = bounds;
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ enum grub_comb_type
|
|||
GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
|
||||
GRUB_UNICODE_STACK_BELOW = 220,
|
||||
GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
|
||||
GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
|
||||
GRUB_UNICODE_STACK_ABOVE = 230,
|
||||
GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
|
||||
GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,
|
||||
|
|
Loading…
Reference in a new issue