Skip to content

Crash with Japanese text #77

@dmurdoch

Description

@dmurdoch

I'm on macOS Sequoia 15.7.2 on an M4, running CRAN R 4.5.2. When I try to run shape_text("\u6771\u4eac") I get a crash. Running in lldb gives this message:

> library(textshaping)
> shape_text("\u6771\u4eac")
Failed to get face: /System/Library/PrivateFrameworks/FontServices.framework/Resources/Reserved/PingFangUI.ttc, 0
Process 36582 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xc0)
    frame #0: 0x000000011117032c textshaping.so`hb_ft_face_create(ft_face=0x0000000000000000, destroy=(textshaping.so`_hb_ft_face_destroy(void*) at hb-ft.cc:125:3)) at hb-ft.cc:1137:17 [opt]
Target 0: (R) stopped.

The font file listed here "PingFangUI.ttc" is the same one that systemfonts::font_fallback() says I should use, and I get a similar error if I specify it explicitly as path and index values.

Here's session info following library(textshaping) in a new session:

> sessionInfo()
R version 4.5.2 (2025-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.7.2

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

time zone: America/Toronto
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] textshaping_1.0.4

loaded via a namespace (and not attached):
[1] compiler_4.5.2    cli_3.6.5         lifecycle_1.0.4   systemfonts_1.3.1
[5] rlang_1.1.6   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions