Open stuta opened 1 month ago
I obviously need to run my compiler with a higher level of warnings, and compile on other platforms.
I have fixed the overzealous usage of 'static INLINE', and those other warnings.
I've removed 'loadDefaultFonts()' from FontHandler, as that is something that is totally platform specific, and should be done at the application level (see svgview sample).
Now other errors are gone, but in OSX there is Courier New font by default, and installing Courier.ttf does not help. Same problem with Arial, but I was able to install it. So can we give our default font names?
I'm not familiar with how fonts are associated in MacOS. I'm assuming you are putting .ttf files in some well known directory, and then loading them into svgandme/blend2d using loadFontDirectory(), or something equivalent.
It is within FontHandler that the font substitution occurs, and the default is selected if nothing else is found. I've almost managed to surface the API enough to change that default. It's just a string value, so I should be able to do it.
Even at that, you will need to ensure the font is loaded in, and then it can be selected.
It will likely be something: FontHandler::setDefaultSerif, setDefaultSans, setDefaultMono, setDefaultCursive
And you'll just pass in the name you want to be the default family.
File svg/svgattributes.h is missing
#include <list>
, fixes std::list. File svg/bithacks.h is missing#include <cctype>
, fixes std::tolower. File svg/maths.hnamespace waavs
static INLINE
needs to be converted toINLINE
.Some warnings:
When I run my program I get an error
FontHandler::loadFont Error: c:\Windows\Fonts\arial.ttf (0x10017)
. Then I get lots of these errors: