mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-08-05 14:40:26 +00:00
Baseline is now calculated correctly
This commit is contained in:
parent
c28310de38
commit
469d0a11e3
1 changed files with 3 additions and 2 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "freetypeamalgam.h"
|
#include "freetypeamalgam.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
|
#include <cmath>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -631,8 +632,8 @@ int32_t FontLoad(const uint8_t *content_original, int32_t content_bytes, int32_t
|
||||||
|
|
||||||
fontManager.fonts[h]->defaultHeight = default_pixel_height; // save default pixel height
|
fontManager.fonts[h]->defaultHeight = default_pixel_height; // save default pixel height
|
||||||
fontManager.fonts[h]->baseline =
|
fontManager.fonts[h]->baseline =
|
||||||
(((float)fontManager.fonts[h]->face->size->metrics.ascender / 64.0f) / ((float)fontManager.fonts[h]->face->size->metrics.height / 64.0f)) *
|
lroundf((((float)fontManager.fonts[h]->face->size->metrics.ascender / 64.0f) / ((float)fontManager.fonts[h]->face->size->metrics.height / 64.0f)) *
|
||||||
(float)default_pixel_height;
|
(float)default_pixel_height);
|
||||||
|
|
||||||
if (options & FONT_MONOSPACE) {
|
if (options & FONT_MONOSPACE) {
|
||||||
// Get the width of upper case W
|
// Get the width of upper case W
|
||||||
|
|
Loading…
Reference in a new issue