mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-12 22:45:13 +00:00
Implement pending changes in #330
This commit is contained in:
parent
2dd0a6a742
commit
1c505561d6
2
Makefile
2
Makefile
|
@ -266,12 +266,10 @@ endif
|
||||||
|
|
||||||
ifneq ($(filter y,$(DEP_FONT)),)
|
ifneq ($(filter y,$(DEP_FONT)),)
|
||||||
EXE_LIBS += $(FREETYPE_OBJS) $(FONT_OBJS)
|
EXE_LIBS += $(FREETYPE_OBJS) $(FONT_OBJS)
|
||||||
QBLIB_NAME := $(addsuffix 1,$(QBLIB_NAME))
|
|
||||||
|
|
||||||
LICENSE_IN_USE += freetype_ftl
|
LICENSE_IN_USE += freetype_ftl
|
||||||
else
|
else
|
||||||
EXE_LIBS += $(FONT_STUB_OBJS)
|
EXE_LIBS += $(FONT_STUB_OBJS)
|
||||||
QBLIB_NAME := $(addsuffix 0,$(QBLIB_NAME))
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(filter y,$(DEP_DEVICEINPUT)),)
|
ifneq ($(filter y,$(DEP_DEVICEINPUT)),)
|
||||||
|
|
|
@ -1,16 +1,38 @@
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
// QB64-PE Font Library
|
// QB64-PE Font Library
|
||||||
// Powered by FreeType 2.4.12 (https://github.com/vinniefalco/FreeTypeAmalgam)
|
// Powered by stb_truetype (https://github.com/nothings/stb)
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#if defined(FONT_DEBUG) && FONT_DEBUG > 0
|
||||||
|
# ifdef _MSC_VER
|
||||||
|
# define FONT_DEBUG_PRINT(_fmt_, ...) fprintf(stderr, "DEBUG: %s:%d:%s(): " _fmt_ "\n", __FILE__, __LINE__, __func__, __VA_ARGS__)
|
||||||
|
# else
|
||||||
|
# define FONT_DEBUG_PRINT(_fmt_, _args_...) fprintf(stderr, "DEBUG: %s:%d:%s(): " _fmt_ "\n", __FILE__, __LINE__, __func__, ##_args_)
|
||||||
|
# endif
|
||||||
|
# define FONT_DEBUG_CHECK(_exp_) \
|
||||||
|
if (!(_exp_)) \
|
||||||
|
FONT_DEBUG_PRINT("Condition (%s) failed", #_exp_)
|
||||||
|
#else
|
||||||
|
# ifdef _MSC_VER
|
||||||
|
# define FONT_DEBUG_PRINT(_fmt_, ...) // Don't do anything in release builds
|
||||||
|
# else
|
||||||
|
# define FONT_DEBUG_PRINT(_fmt_, _args_...) // Don't do anything in release builds
|
||||||
|
# endif
|
||||||
|
# define FONT_DEBUG_CHECK(_exp_) // Don't do anything in release builds
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern uint16_t codepage437_to_unicode16[]; // ASCII to UTF-16 LUT
|
||||||
|
|
||||||
int32_t FontRenderTextUTF32(int32_t i, uint32_t *codepoint, int32_t codepoints, int32_t options, uint8_t **out_data, int32_t *out_x, int32_t *out_y,
|
|
||||||
int32_t *out_x_pre_increment, int32_t *out_x_post_increment);
|
|
||||||
int32_t FontLoad(uint8_t *content_original, int32_t content_bytes, int32_t default_pixel_height, int32_t which_font, int32_t options);
|
int32_t FontLoad(uint8_t *content_original, int32_t content_bytes, int32_t default_pixel_height, int32_t which_font, int32_t options);
|
||||||
int32_t FontRenderTextASCII(int32_t i, uint8_t *codepoint, int32_t codepoints, int32_t options, uint8_t **out_data, int32_t *out_x, int32_t *out_y,
|
void FontFree(int32_t fh);
|
||||||
|
int32_t FontWidth(int32_t fh);
|
||||||
|
int32_t FontRenderTextUTF32(int32_t fh, uint32_t *codepoint, int32_t codepoints, int32_t options, uint8_t **out_data, int32_t *out_x, int32_t *out_y,
|
||||||
int32_t *out_x_pre_increment, int32_t *out_x_post_increment);
|
int32_t *out_x_pre_increment, int32_t *out_x_post_increment);
|
||||||
int32_t FontWidth(int32_t i);
|
int32_t FontRenderTextASCII(int32_t fh, uint8_t *codepoint, int32_t codepoints, int32_t options, uint8_t **out_data, int32_t *out_x, int32_t *out_y,
|
||||||
void FontFree(int32_t i);
|
int32_t *out_x_pre_increment, int32_t *out_x_post_increment);
|
||||||
|
int32_t FontPrintWidthASCII(int32_t fh, uint8_t *codepoint, int32_t codepoints);
|
|
@ -14,9 +14,9 @@ FONT_OBJS := $(patsubst %.cpp,$(PATH_INTERNAL_C)/parts/video/font/%.o,$(FONT_SRC
|
||||||
FONT_STUB_OBJS := $(patsubst %.cpp,$(PATH_INTERNAL_C)/parts/video/font/%.o,$(FONT_STUB_SRCS))
|
FONT_STUB_OBJS := $(patsubst %.cpp,$(PATH_INTERNAL_C)/parts/video/font/%.o,$(FONT_STUB_SRCS))
|
||||||
|
|
||||||
$(PATH_INTERNAL_C)/parts/video/font/%.o: $(PATH_INTERNAL_C)/parts/video/font/%.c
|
$(PATH_INTERNAL_C)/parts/video/font/%.o: $(PATH_INTERNAL_C)/parts/video/font/%.c
|
||||||
$(CC) -O2 $(CFLAGS) -DDEPENDENCY_CONSOLE_ONLY -Wall $< -c -o $@
|
$(CC) -O2 $(CFLAGS) -Wall $< -c -o $@
|
||||||
|
|
||||||
$(PATH_INTERNAL_C)/parts/video/font/%.o: $(PATH_INTERNAL_C)/parts/video/font/%.cpp
|
$(PATH_INTERNAL_C)/parts/video/font/%.o: $(PATH_INTERNAL_C)/parts/video/font/%.cpp
|
||||||
$(CXX) -O2 $(CXXFLAGS) -DDEPENDENCY_CONSOLE_ONLY -Wall $< -c -o $@
|
$(CXX) -O2 $(CXXFLAGS) -Wall $< -c -o $@
|
||||||
|
|
||||||
CLEAN_LIST += $(FREETYPE_OBJS) $(FONT_OBJS) $(FONT_STUB_OBJS)
|
CLEAN_LIST += $(FREETYPE_OBJS) $(FONT_OBJS) $(FONT_STUB_OBJS)
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
#include "freetypeamalgam.h"
|
#include "freetypeamalgam.h"
|
||||||
#include "rounding.h"
|
#include "rounding.h"
|
||||||
|
|
||||||
extern uint16_t codepage437_to_unicode16[];
|
|
||||||
|
|
||||||
FT_Library ft_library;
|
FT_Library ft_library;
|
||||||
|
|
||||||
struct fonts_struct {
|
struct fonts_struct {
|
||||||
|
|
Loading…
Reference in a new issue