mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
* Good start
* Impl
* allow responses.add(async { Message::NoOp });
* Fix
* Cache font blob in text node
* Refactor font handling to use Font struct direcly
* Fix fmt
* Embedd Font Resources by default
* Review
* Review
* Cache font info based on ResourceHash
19 lines
784 B
Rust
19 lines
784 B
Rust
use super::TypesettingConfig;
|
|
use super::text_context::TextContext;
|
|
use core_types::list::List;
|
|
use glam::DVec2;
|
|
use graphene_resource::Resource;
|
|
use vector_types::Vector;
|
|
|
|
pub fn to_path(text: &str, font: &Resource, typesetting: TypesettingConfig, per_glyph_items: bool) -> List<Vector> {
|
|
TextContext::with_thread_local(|ctx| ctx.to_path(text, font, typesetting, per_glyph_items))
|
|
}
|
|
|
|
pub fn bounding_box(text: &str, font: &Resource, typesetting: TypesettingConfig, for_clipping_test: bool) -> DVec2 {
|
|
TextContext::with_thread_local(|ctx| ctx.bounding_box(text, font, typesetting, for_clipping_test))
|
|
}
|
|
|
|
pub fn lines_clipping(text: &str, font: &Resource, typesetting: TypesettingConfig) -> bool {
|
|
TextContext::with_thread_local(|ctx| ctx.lines_clipping(text, font, typesetting))
|
|
}
|