mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-20 09:23:10 +01:00
Merge pull request #8576 from storytold/fix/font-catalog-visual-order
text: fix the build after #7904 (craft-font-catalog pin, shared outline call)
This commit is contained in:
3 files changed
+9
-11
No files matched your search
Generated
+3
-1
@@ -1047,12 +1047,14 @@ source = "git+https://github.com/storytold/craft-libs?rev=64b181977a0488e4d1e167
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "craft-font-catalog"
|
name = "craft-font-catalog"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/storytold/craft-libs?rev=d0a9c79933a54883cd5bc3dfe839f1dd699f2c69#d0a9c79933a54883cd5bc3dfe839f1dd699f2c69"
|
source = "git+https://github.com/storytold/craft-libs?rev=23acc704933a9a5619a5cd1cddc9bb1fb5a9b2d3#23acc704933a9a5619a5cd1cddc9bb1fb5a9b2d3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"harfrust 0.13.3",
|
"harfrust 0.13.3",
|
||||||
"kurbo 0.13.1",
|
"kurbo 0.13.1",
|
||||||
"skrifa 0.47.0",
|
"skrifa 0.47.0",
|
||||||
"thiserror 2.0.21",
|
"thiserror 2.0.21",
|
||||||
|
"unicode-bidi",
|
||||||
|
"unicode-segmentation",
|
||||||
"windows-registry",
|
"windows-registry",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ description = "VectorCraft text: font database, shaping, layout, glyph outlines"
|
|||||||
workspace = true
|
workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Pending shared extraction; pin the immutable official PR head until it merges.
|
# The shared font catalog from craft-libs main (it has the outline, bidi and caret helpers used here).
|
||||||
craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "d0a9c79933a54883cd5bc3dfe839f1dd699f2c69", default-features = false }
|
craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "23acc704933a9a5619a5cd1cddc9bb1fb5a9b2d3", default-features = false }
|
||||||
vectorcraft-geom = { workspace = true }
|
vectorcraft-geom = { workspace = true }
|
||||||
vectorcraft-doc = { workspace = true }
|
vectorcraft-doc = { workspace = true }
|
||||||
kurbo = { workspace = true }
|
kurbo = { workspace = true }
|
||||||
|
|||||||
@@ -10,10 +10,7 @@ use super::names::{norm, norm_chars, script_families};
|
|||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
use super::scan::{enumerate_faces, font_files};
|
use super::scan::{enumerate_faces, font_files};
|
||||||
use super::traits::{Alias, FontMatch, FontTraits, regular_rank};
|
use super::traits::{Alias, FontMatch, FontTraits, regular_rank};
|
||||||
use super::{
|
use super::{Arc, BezPath, CANONICAL_CACHE_MAX, Color, ColourContent, FontDb, GlyphImage, MetadataProvider, NEXT_ID, OUTLINE_CACHE_MAX, Ordering};
|
||||||
Arc, BezPath, CANONICAL_CACHE_MAX, Color, ColourContent, FontDb, GlyphId, GlyphImage, MetadataProvider, NEXT_ID, OUTLINE_CACHE_MAX, Ordering,
|
|
||||||
Size,
|
|
||||||
};
|
|
||||||
|
|
||||||
/// The most faces [`FontDb::postscript_faces`] gives, and the most families it loads.
|
/// The most faces [`FontDb::postscript_faces`] gives, and the most families it loads.
|
||||||
const MAX_POSTSCRIPT_FACES: usize = 16;
|
const MAX_POSTSCRIPT_FACES: usize = 16;
|
||||||
@@ -655,10 +652,9 @@ impl FontDb {
|
|||||||
return p.clone();
|
return p.clone();
|
||||||
}
|
}
|
||||||
let mut pen = FlipPen(BezPath::new());
|
let mut pen = FlipPen(BezPath::new());
|
||||||
if let Some(f) = face.skrifa()
|
if let Ok(font) = craft_font_catalog::FontOutline::from_bytes(face.data(), face.index(), face.variations()) {
|
||||||
&& let Some(g) = f.outline_glyphs().get(GlyphId::new(gid))
|
// As before, keep the prefix emitted before a malformed glyph reports an error.
|
||||||
{
|
let _ = font.draw_to(gid, &mut pen);
|
||||||
let _ = g.draw(DrawSettings::unhinted(Size::unscaled(), face.location()), &mut pen);
|
|
||||||
}
|
}
|
||||||
let p = Arc::new(pen.0);
|
let p = Arc::new(pen.0);
|
||||||
let mut cache = self.outlines.lock().unwrap_or_else(|e| e.into_inner());
|
let mut cache = self.outlines.lock().unwrap_or_else(|e| e.into_inner());
|
||||||
|
|||||||
Reference in new issue
Block a user