Skip to content

Commit

Permalink
fix(font): failed to get bitmap when font_size > 18
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-soft committed Oct 8, 2019
1 parent 45444de commit d6315c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/font/in-core/font_inconsolata.c
Original file line number Diff line number Diff line change
Expand Up @@ -7609,21 +7609,21 @@ int FontInconsolata_GetBitmap(LCUI_FontBitmap *bmp, wchar_t ch, int size)
int i, j, *ptr;
const uchar_t *byte_ptr;

if (size < 12 || size > 18) {
if (size < 12) {
return -1;
}
/* 不在范围内的字符都用框框表示 */
if (ch < ' ' || ch > '~') {
if (ch < ' ' || ch > '~' || size > 18) {
bmp->advance.x = (int)(size / 2.0 + 0.5);
bmp->advance.y = size;
bmp->rows = size;
bmp->width = bmp->advance.x;
bmp->buffer = calloc(bmp->rows*bmp->width, 1);
bmp->buffer = calloc(bmp->rows * bmp->width, 1);
bmp->pitch = bmp->width;
bmp->pixel_mode = 0;
bmp->top = size * 4 / 5;
bmp->left = 0;
j = (bmp->rows - 1)*bmp->width;
j = (bmp->rows - 1) * bmp->width;
for (i = 0; i < bmp->width; ++i, ++j) {
bmp->buffer[i] = 255;
bmp->buffer[j] = 255;
Expand Down

0 comments on commit d6315c5

Please sign in to comment.