minor changes
This commit is contained in:
@@ -39,8 +39,8 @@ namespace OpenVulkano
|
|||||||
{
|
{
|
||||||
FcPattern* font = fs->fonts[i];
|
FcPattern* font = fs->fonts[i];
|
||||||
FcChar8* file;
|
FcChar8* file;
|
||||||
FcChar8 *style;
|
FcChar8* style;
|
||||||
FcChar8 *family;
|
FcChar8* family;
|
||||||
if (FcPatternGetString(font, FC_FILE, 0, &file) == FcResultMatch &&
|
if (FcPatternGetString(font, FC_FILE, 0, &file) == FcResultMatch &&
|
||||||
FcPatternGetString(font, FC_FAMILY, 0, &family) == FcResultMatch &&
|
FcPatternGetString(font, FC_FAMILY, 0, &family) == FcResultMatch &&
|
||||||
FcPatternGetString(font, FC_STYLE, 0, &style) == FcResultMatch)
|
FcPatternGetString(font, FC_STYLE, 0, &style) == FcResultMatch)
|
||||||
|
|||||||
@@ -49,14 +49,7 @@ namespace OpenVulkano
|
|||||||
{
|
{
|
||||||
// remove null-terminated characters since size is always bigger than needed
|
// remove null-terminated characters since size is always bigger than needed
|
||||||
std::string fontNameCropped(fontName.begin(), fontName.end());
|
std::string fontNameCropped(fontName.begin(), fontName.end());
|
||||||
size_t realSize = 0;
|
size_t realSize = strlen(fontNameCropped.data());
|
||||||
for (; realSize < fontNameCropped.size(); realSize++)
|
|
||||||
{
|
|
||||||
if (fontNameCropped[realSize] == '\0')
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fontNameCropped.resize(realSize);
|
fontNameCropped.resize(realSize);
|
||||||
Utils::ToLower(fontNameCropped);
|
Utils::ToLower(fontNameCropped);
|
||||||
fontFileMapping[std::move(fontNameCropped)] = fontFilename.path().string();
|
fontFileMapping[std::move(fontNameCropped)] = fontFilename.path().string();
|
||||||
|
|||||||
Reference in New Issue
Block a user