Comments (9)
This seems likely to have been caused by dfrg/swash#52. As a workaround, I'd recommend pinning an older version of Swash.
(CC: @dfrg)
from cosmic-text.
Thanks for reporting. A bit more context would be helpful in identifying the problem. Which version of macOS? Do you know if these happen to be .ttc files?
from cosmic-text.
I'm on MacOS 13.5.1 (22G90). All of the files listed above are .ttc files. But I can also find .ttf files that fail. One example is the font Big Caslon.
from cosmic-text.
Thanks, I'll dig up a macOS 13 system and take a look at those fonts.
from cosmic-text.
I'm not able to reproduce this locally so I can only assume that the issue is related to the wasm build. Unfortunately, I don't really work with wasm and don't have a rig set up to do testing so I won't be able to investigate this further until I have the time to set one up.
from cosmic-text.
Alright, thank you. I'll dig around a bit tomorrow and report back if I can figure out where things go wrong. Appreciate your time:)
from cosmic-text.
Hey again @dfrg .
I did some digging, and found that Skrifa is returning a ReadError::InvalidSfnt(0x74727565)
for the fonts in question.
Looking up Apple's TrueType reference, I found this:
The values 'true' (0x74727565) and 0x00010000 are recognized by OS X and iOS as referring to TrueType fonts.
The value 'typ1' (0x74797031) is recognized as referring to the old style of PostScript font housed in a sfnt wrapper.
The value 'OTTO' (0x4F54544F) indicates an OpenType font with PostScript outlines
(that is, a 'CFF ' table instead of a 'glyf' table). Other values are not currently supported.
Fonts with TrueType outlines produced for OS X or iOS only are encouraged
to use 'true' (0x74727565) for the scaler type value.
Fonts for Windows or Adobe products must use 0x00010000.
A bit out of my depth, but it kinda sorta sounds to me like 0x74727565
should be included in this check in the read-fonts crate:
fn with_table_directory(
data: FontData<'a>,
table_directory: TableDirectory<'a>,
) -> Result<Self, ReadError> {
if [TT_SFNT_VERSION, CFF_SFTN_VERSION].contains(&table_directory.sfnt_version()) {
Ok(FontRef {
data,
table_directory,
})
} else {
Err(ReadError::InvalidSfnt(table_directory.sfnt_version()))
}
}
I still haven't checked this outside of a wasm build, but it feels curious that your weren't able to reproduce this yourself. I don't understand how running in wasm could change the sfnt version.
from cosmic-text.
I’m not sure either but as luck would have it, we added the true
tag a while back and just released a new version of skrifa yesterday containing this change. I’ll update swash later today but you might be able to patch with skrifa version 0.20 to see if it works.
from cosmic-text.
ref googlefonts/fontations#961
from cosmic-text.
Related Issues (20)
- Raname directory or file - highlight current name (without extension) HOT 1
- Make menu option insensitive when they don't do anything
- Empty line of a certain span should have line height for that span
- Replace layout-based scroll with pixel-based.
- Broken rendering with some fonts (vertical stretching of the last pixels) HOT 4
- More options to set syntax highlighting for content HOT 4
- Adds spaces to start of current line when switching with alt-tab HOT 2
- Font Fallback Regression with Thaana script
- `cosmic-text` tests: "No default font found" HOT 1
- Is there any way to disable hinting and anti-aliasing?
- Make reshaping/relayouting when inputs change lazy
- line_y < 0.0 in LayoutRunIter for certain fonts HOT 5
- Full support for fontconfig
- Editor Clone HOT 1
- Save and resume editor state / handle external HOT 1
- "Failed to load font 'bootstrap-icons'" regression
- Arabic words must never be split by line breaking. HOT 1
- Buffer is lossy / loses source information
- Bidi behavior of `set_text()` vs. `set_rich_text()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cosmic-text.