diff --git a/src/Game.c b/src/Game.c index bbfa99af9..673a9de35 100644 --- a/src/Game.c +++ b/src/Game.c @@ -765,14 +765,3 @@ void Game_Run(Int32 width, Int32 height, const String* title, struct DisplayDevi Game_RenderFrame(time); } } - -/* TODO: Implement all these stubs.... */ -#if CC_BUILD_NIX -void Font_Make(FontDesc* desc, const String* fontName, UInt16 size, UInt16 style) { desc->Size = size; desc->Style = style; } -void Font_Free(FontDesc* desc) { } -void Font_GetNames(StringsBuffer* buffer) { } -Size2D Platform_TextMeasure(struct DrawTextArgs* args) { } -void Platform_SetBitmap(Bitmap* bmp) { } -Size2D Platform_TextDraw(struct DrawTextArgs* args, Int32 x, Int32 y, PackedCol col) { } -void Platform_ReleaseBitmap(void) { } -#endif diff --git a/src/Platform.c b/src/Platform.c index 5a285036c..2456e29f7 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -735,7 +735,7 @@ void Font_Free(FontDesc* desc) { } static void Font_DirCallback(const String* filename, void* obj) { - char pathBuffer[MAX_PATH * 5 + 1]; + char pathBuffer[FILENAME_SIZE + 1]; String path = String_NT_Array(pathBuffer); String* dir = obj; @@ -747,7 +747,7 @@ static void Font_DirCallback(const String* filename, void* obj) { if (error) return; bool styled = (face->style_flags & FT_STYLE_FLAG_BOLD) || (face->style_flags & FT_STYLE_FLAG_ITALIC); - if (!styled) { + if (!styled && face->family_name) { StringsBuffer_Add(&fonts_list, &path); path.length = 0; @@ -799,7 +799,7 @@ Size2D Platform_TextDraw(struct DrawTextArgs* args, Bitmap* bmp, Int32 x, Int32 y += offset; for (yy = 0; yy < img->rows; yy++) { - if ((y + yy) < 0|| (y + yy) >= bmp->Height) continue; + if ((y + yy) < 0 || (y + yy) >= bmp->Height) continue; UInt8* src = img->buffer + (yy * img->width); UInt8* dst = (UInt8*)Bitmap_GetRow(bmp, y + yy) + (x * BITMAP_SIZEOF_PIXEL); @@ -815,6 +815,7 @@ Size2D Platform_TextDraw(struct DrawTextArgs* args, Bitmap* bmp, Int32 x, Int32 src++; dst += BITMAP_SIZEOF_PIXEL; } } + x += TEXT_CEIL(face->glyph->advance.x); y -= offset; } diff --git a/src/freetype/ftver.rc b/src/freetype/ftver.rc deleted file mode 100644 index a2903d588..000000000 --- a/src/freetype/ftver.rc +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftver.rc */ -/* */ -/* FreeType VERSIONINFO resource for Windows DLLs. */ -/* */ -/* Copyright 2018 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include - -#define FT_VERSION 2,9,1,0 -#define FT_VERSION_STR "2.9.1" - -VS_VERSION_INFO VERSIONINFO -FILEVERSION FT_VERSION -PRODUCTVERSION FT_VERSION -FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#ifdef _DEBUG -FILEFLAGS VS_FF_DEBUG -#endif -#ifdef _DLL -FILETYPE VFT_DLL -#define FT_FILENAME "freetype.dll" -#else -FILETYPE VFT_STATIC_LIB -#define FT_FILENAME "freetype.lib" -#endif -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4" - BEGIN - VALUE "CompanyName", "The FreeType Project" - VALUE "FileDescription", "Font Rendering Library" - VALUE "FileVersion", FT_VERSION_STR - VALUE "ProductName", "FreeType" - VALUE "ProductVersion", FT_VERSION_STR - VALUE "LegalCopyright", "\251 2018 The FreeType Project www.freetype.org. All rights reserved." - VALUE "InternalName", "freetype" - VALUE "OriginalFilename", FT_FILENAME - END - END - - BLOCK "VarFileInfo" - BEGIN - /* The following line should only be modified for localized versions. */ - /* It consists of any number of WORD,WORD pairs, with each pair */ - /* describing a "language,codepage" combination supported by the file. */ - VALUE "Translation", 0x409, 1252 - END -END