mirror of https://github.com/OpenTTD/OpenTTD
Compare commits
No commits in common. "2b599c9d00f970074085e1025fa90cec2a6aa81c" and "7faa3848debf0d59fc79b5f9078b375369e3224e" have entirely different histories.
2b599c9d00
...
7faa3848de
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include "safeguards.h"
|
#include "safeguards.h"
|
||||||
|
|
||||||
/** HarfBuzz FreeType integration sets the font scaling, which is always in 1/64th of a pixel. */
|
/** harfbuzz doesn't use floats, so we need a value to scale position with to get sub-pixel precision. */
|
||||||
constexpr float FONT_SCALE = 64.0;
|
constexpr float FONT_SCALE = 64.0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -157,8 +157,7 @@ ICUParagraphLayout::ICUVisualRun::ICUVisualRun(const ICURun &run, int x) :
|
||||||
void ICURun::Shape(UChar *buff, size_t buff_length)
|
void ICURun::Shape(UChar *buff, size_t buff_length)
|
||||||
{
|
{
|
||||||
auto hbfont = hb_ft_font_create_referenced(*(static_cast<const FT_Face *>(font->fc->GetOSHandle())));
|
auto hbfont = hb_ft_font_create_referenced(*(static_cast<const FT_Face *>(font->fc->GetOSHandle())));
|
||||||
/* Match the flags with how we render the glyphs. */
|
hb_font_set_scale(hbfont, this->font->fc->GetFontSize() * FONT_SCALE, this->font->fc->GetFontSize() * FONT_SCALE);
|
||||||
hb_ft_font_set_load_flags(hbfont, GetFontAAState(this->font->fc->GetSize()) ? FT_LOAD_TARGET_NORMAL : FT_LOAD_TARGET_MONO);
|
|
||||||
|
|
||||||
/* ICU buffer is in UTF-16. */
|
/* ICU buffer is in UTF-16. */
|
||||||
auto hbbuf = hb_buffer_create();
|
auto hbbuf = hb_buffer_create();
|
||||||
|
|
Loading…
Reference in New Issue