diff --git a/src/os/macosx/string_osx.cpp b/src/os/macosx/string_osx.cpp index f263db3753..89ff8c6bb3 100644 --- a/src/os/macosx/string_osx.cpp +++ b/src/os/macosx/string_osx.cpp @@ -15,6 +15,7 @@ #include "../../fontcache.h" #include "../../zoom_func.h" #include "macos.h" +#include #include @@ -253,7 +254,7 @@ CoreTextParagraphLayout::CoreTextVisualRun::CoreTextVisualRun(CTRunRef run, Font this->positions[i * 2 + 1] = pts[i].y; } } - this->total_advance = (int)CTRunGetTypographicBounds(run, CFRangeMake(0, 0), nullptr, nullptr, nullptr); + this->total_advance = (int)std::ceil(CTRunGetTypographicBounds(run, CFRangeMake(0, 0), nullptr, nullptr, nullptr)); this->positions[this->glyphs.size() * 2] = this->positions[0] + this->total_advance; }