Comments (7)
Process 96665 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
frame #0: 0x00000001000131b4 render-glyph`font_kit::loaders::core_text::Font::typographic_bounds::he1e3ef41c5dc828f(self=0x000000016fdfeef8, glyph_id=48) at core_text.rs:354:27
351 .core_text_font
352 .get_bounding_rects_for_glyphs(kCTFontDefaultOrientation, &[glyph_id as u16]);
353 let rect = RectF::new(
-> 354 Vector2F::new(rect.origin.x as f32, rect.origin.y as f32),
355 Vector2F::new(rect.size.width as f32, rect.size.height as f32),
356 );
357 Ok(rect * self.units_per_point() as f32)
Target 0: (render-glyph) stopped.
(lldb) p rect
(core_graphics_types::geometry::CGRect) $4 = {
origin = (x = 0.671875, y = 0)
size = (width = 8.2734375, height = 11.6640625)
}
rect seems good after call to CTFontGetBoundingRectsForGlyphs (from .get_bounding_rects_for_glyphs
)
from font-kit.
After running
let rect = RectF::new(
Vector2F::new(rect.origin.x as f32, rect.origin.y as f32),
Vector2F::new(rect.size.width as f32, rect.size.height as f32),
);
it becomes
Process 96665 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
frame #0: 0x0000000100013224 render-glyph`font_kit::loaders::core_text::Font::typographic_bounds::he1e3ef41c5dc828f(self=0x000000016fdfeef8, glyph_id=48) at core_text.rs:357:19
354 Vector2F::new(rect.origin.x as f32, rect.origin.y as f32),
355 Vector2F::new(rect.size.width as f32, rect.size.height as f32),
356 );
-> 357 Ok(rect * self.units_per_point() as f32)
358 }
359
360 /// Returns the distance from the origin of the glyph with the given ID to the next, in font
Target 0: (render-glyph) stopped.
(lldb) p rect
(pathfinder_geometry::rect::RectF) $5 = {
__0 = {
__0 = (__0 = 0.671875, __1 = 0, __2 = 0.671875, __3 = 0)
}
}
i.e. completely empty RectF.
from font-kit.
Origin and size are ok, but constructing RectF causes it to collapse (?)
origin:
CGPoint { x: 0.671875, y: 0.0 } vs Vector2F(<0.671875, 0>)
size:
CGSize { width: 8.2734375, height: 11.6640625 } vs Vector2F(<8.2734375, 11.6640625>)
result:
RectF(<0.671875, 0, 0.671875, 0>) and point size 128.0
this is all in
/// Returns the boundaries of a glyph in font units.
pub fn typographic_bounds(&self, glyph_id: u32) -> Result<RectF, GlyphLoadingError> {
let rect = self
.core_text_font
.get_bounding_rects_for_glyphs(kCTFontDefaultOrientation, &[glyph_id as u16]);
let origin =
Vector2F::new(rect.origin.x as f32, rect.origin.y as f32);
let size =
Vector2F::new(rect.size.width as f32, rect.size.height as f32);
println!("{:?} vs {:?}", rect.origin, origin);
println!("{:?} vs {:?}", rect.size, size);
let rect = RectF::new(origin, size);
println!("{:?} and point size {:?}", rect, self.units_per_point());
Ok(rect * self.units_per_point() as f32)
}
from font-kit.
Looks like the bug is in pathfinder_simd implementation - depending with features = ["pf-no-simd"]
renders the glyph.
from font-kit.
Fix proposed servo/pathfinder#452
from font-kit.
^
merged, necessary to bump and release versions.
from font-kit.
pathfinder_simd has released 0.5.1 about two weeks ago, bump?
from font-kit.
Related Issues (20)
- Rasterization to Rgba32 from Rgb24 causes panic on windows.
- Implement font fallback for macOS
- Anti-aliased glyphs sometimes get pixels clipped off during rasterization on MacOS
- Initialize `FsSource` with any directories HOT 1
- Provide APIs which allow using a font from `&'static [u8]`
- How to render text into one line with a given font? HOT 1
- How to measure text? HOT 1
- It is possible to use font-kit to render glyphs in an HTML5 canvas using WebAssembly (WASM)
- load font extremely slowly on macos than in windows and linux. HOT 1
- How to get the path of a character?
- font-kit fails to compile with slint HOT 4
- Potential font loading performance increase of >50%
- Load system UI font HOT 2
- select_font tests fail when other fonts present on the system HOT 1
- v0.12 SIGSEGV: invalid memory reference HOT 1
- Looking up fallback/generic versions of fonts (e.g. Times New Roman) HOT 2
- use `windows` crate instead of `winapi`
- Cargo pulling in source dependencies even when the source feature is disabled HOT 4
- Cannot access source error on macOS HOT 3
- Need to update `pathfinder_simd` HOT 4
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 font-kit.