Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
macos:
name: CI

runs-on: macos-latest
runs-on: macos-15
env:
MACOSX_DEPLOYMENT_TARGET: 10.13

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
macos:
name: MacOS

runs-on: macos-latest
runs-on: macos-15
env:
MACOSX_DEPLOYMENT_TARGET: 10.13

Expand Down
16 changes: 8 additions & 8 deletions src/os/macosx/string_osx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,22 +235,22 @@ CoreTextParagraphLayout::CoreTextVisualRun::CoreTextVisualRun(CTRunRef run, Font
this->glyphs.resize(CTRunGetGlyphCount(run));

/* Query map of glyphs to source string index. */
CFIndex map[this->glyphs.size()];
CTRunGetStringIndices(run, CFRangeMake(0, 0), map);
std::unique_ptr<CFIndex[]> map = std::make_unique<CFIndex[]>(this->glyphs.size());
CTRunGetStringIndices(run, CFRangeMake(0, 0), map.get());

this->glyph_to_char.resize(this->glyphs.size());
for (size_t i = 0; i < this->glyph_to_char.size(); i++) this->glyph_to_char[i] = (int)map[i];

CGPoint pts[this->glyphs.size()];
CTRunGetPositions(run, CFRangeMake(0, 0), pts);
CGSize advs[this->glyphs.size()];
CTRunGetAdvances(run, CFRangeMake(0, 0), advs);
std::unique_ptr<CGPoint[]> pts = std::make_unique<CGPoint[]>(this->glyphs.size());
CTRunGetPositions(run, CFRangeMake(0, 0), pts.get());
std::unique_ptr<CGSize[]> advs = std::make_unique<CGSize[]>(this->glyphs.size());
CTRunGetAdvances(run, CFRangeMake(0, 0), advs.get());
this->positions.reserve(this->glyphs.size());

/* Convert glyph array to our data type. At the same time, substitute
* the proper glyphs for our private sprite glyphs. */
CGGlyph gl[this->glyphs.size()];
CTRunGetGlyphs(run, CFRangeMake(0, 0), gl);
std::unique_ptr<CGGlyph[]> gl = std::make_unique<CGGlyph[]>(this->glyphs.size());
CTRunGetGlyphs(run, CFRangeMake(0, 0), gl.get());
for (size_t i = 0; i < this->glyphs.size(); i++) {
if (buff[this->glyph_to_char[i]] >= SCC_SPRITE_START && buff[this->glyph_to_char[i]] <= SCC_SPRITE_END && (gl[i] == 0 || gl[i] == 3)) {
/* A glyph of 0 indidicates not found, while apparently 3 is what char 0xFFFC maps to. */
Expand Down
Loading