New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tidy up font code #330
Tidy up font code #330
Conversation
@@ -265,12 +265,12 @@ else | |||
endif | |||
|
|||
ifneq ($(filter y,$(DEP_FONT)),) | |||
EXE_LIBS += $(QB_FONT_LIB) | |||
CXXFLAGS += -DDEPENDENCY_LOADFONT | |||
EXE_LIBS += $(FREETYPE_OBJS) $(FONT_OBJS) | |||
QBLIB_NAME := $(addsuffix 1,$(QBLIB_NAME)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the define is gone we can get rid of the QBLIB_NAME addition as well :) Very good stuff, it puts us one step closer to not having any more conditional compilation for libqb.cpp
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted.
#include "freetypeamalgam.h" | ||
#include "rounding.h" | ||
|
||
extern uint16_t codepage437_to_unicode16[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this extern
should go in font.h
. We also might consider moving the actual declaration into this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea.👍 I'll make this change in the next PR.
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 | ||
$(CC) -O2 $(CFLAGS) -DDEPENDENCY_CONSOLE_ONLY -Wall $< -c -o $@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For these lines you can get rid of the -DDEPENDENCY_CONSOLE_ONLY
because none of these files depend on libqb.h
(which was causing the problems).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted.
This PR is an effort (the first of many) to reach the end goal in #188.
The following changes were made:
internal/c/parts/video/font/
and remove unnecessary filessrc.c
fromlibqb.cpp
and instead move font code tofont.cpp
that is compiled using a makefileIn subsequent font PRs, I'll try to move more font functions to
font.cpp
until we have something that is more-or-less self-contained.The ultimate step would be to swap out
FreeTypeAmalgam
withstb_truetype
.