mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 18:45:23 -04:00
C client: Fix some fonts being too high
This commit is contained in:
parent
ab8f1f3d67
commit
c0aefc5fec
@ -804,14 +804,14 @@ Size2D Platform_TextDraw(struct DrawTextArgs* args, Bitmap* bmp, Int32 x, Int32
|
||||
FT_Face face = args->Font.Handle;
|
||||
String text = args->Text;
|
||||
Size2D s = { x, TEXT_CEIL(face->size->metrics.height) };
|
||||
Int32 i;
|
||||
Int32 i, descender = TEXT_CEIL(face->size->metrics.descender);
|
||||
|
||||
for (i = 0; i < text.length; i++) {
|
||||
UInt16 c = Convert_CP437ToUnicode(text.buffer[i]);
|
||||
FT_Load_Char(face, c, FT_LOAD_RENDER); /* TODO: Check error */
|
||||
|
||||
FT_Bitmap* img = &face->glyph->bitmap; /* TODO: face->size->metrics->descender */
|
||||
Int32 xx, yy, offset = s.Height + TEXT_CEIL(face->descender) - face->glyph->bitmap_top;
|
||||
FT_Bitmap* img = &face->glyph->bitmap;
|
||||
Int32 xx, yy, offset = s.Height + descender - face->glyph->bitmap_top;
|
||||
y += offset;
|
||||
|
||||
for (yy = 0; yy < img->rows; yy++) {
|
||||
@ -827,7 +827,7 @@ Size2D Platform_TextDraw(struct DrawTextArgs* args, Bitmap* bmp, Int32 x, Int32
|
||||
dst[1] = ((col.G * intensity) >> 8) + ((dst[1] * invIntensity) >> 8);
|
||||
dst[2] = ((col.R * intensity) >> 8) + ((dst[2] * invIntensity) >> 8);
|
||||
//dst[3] = ((col.A * intensity) >> 8) + ((dst[3] * invIntensity) >> 8);
|
||||
dst[3] = intensity + ((dst[3] * invIntensity) >> 8);
|
||||
dst[3] = intensity + ((dst[3] * invIntensity) >> 8);
|
||||
src++; dst += BITMAP_SIZEOF_PIXEL;
|
||||
}
|
||||
}
|
||||
|
@ -373,21 +373,6 @@
|
||||
#define FT_TRUETYPE_DRIVER_H FT_DRIVER_H
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_PCF_DRIVER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing
|
||||
* structures and macros related to the PCF driver module.
|
||||
*
|
||||
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
|
||||
*
|
||||
*/
|
||||
#define FT_PCF_DRIVER_H FT_DRIVER_H
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
@ -443,20 +428,6 @@
|
||||
#define FT_TRUETYPE_TAGS_H "tttags.h"
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BDF_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API which accesses BDF-specific strings from a
|
||||
* face.
|
||||
*
|
||||
*/
|
||||
#define FT_BDF_H "ftbdf.h"
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
@ -471,58 +442,6 @@
|
||||
#define FT_CID_H "ftcid.h"
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GZIP_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API which supports gzip-compressed files.
|
||||
*
|
||||
*/
|
||||
#define FT_GZIP_H "ftgzip.h"
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_LZW_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API which supports LZW-compressed files.
|
||||
*
|
||||
*/
|
||||
#define FT_LZW_H "ftlzw.h"
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BZIP2_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API which supports bzip2-compressed files.
|
||||
*
|
||||
*/
|
||||
#define FT_BZIP2_H "ftbzip2.h"
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_WINFONTS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API which supports Windows FNT files.
|
||||
*
|
||||
*/
|
||||
#define FT_WINFONTS_H "ftwinfnt.h"
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include FT_TRUETYPE_TAGS_H
|
||||
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
|
||||
#include FT_SFNT_NAMES_H
|
||||
#include FT_GZIP_H
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
#include FT_SERVICE_MULTIPLE_MASTERS_H
|
||||
@ -36,10 +35,6 @@
|
||||
|
||||
#include "sferrors.h"
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_BDF
|
||||
#include "ttbdf.h"
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
|
Loading…
x
Reference in New Issue
Block a user