Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ all-features = true
[dependencies]
plotive-base.workspace = true
plotive-text.workspace = true
rustybuzz.workspace = true
ttf-parser.workspace = true
# feature dsl
plotive-dsl = { workspace = true, optional = true }
# feature data-polars
Expand Down Expand Up @@ -151,10 +149,10 @@ rand_distr = "0.5.1"
rand_chacha = "0.9.0"
rfd = "0.17.1"
rustybuzz = "0.20.1"
strict-num = "0.2.0"
tiny-skia = "0.11.4"
tiny-skia-path = "0.11.4"
tokio = { version = "1.0", features = ["rt", "rt-multi-thread", "time"] }
strict-num = "0.2.0"

[workspace.dependencies.ttf-parser]
version = "0.25.1"
Expand Down
10 changes: 5 additions & 5 deletions src/drawing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ impl From<text::Error> for Error {
}
}

impl From<ttf_parser::FaceParsingError> for Error {
fn from(err: ttf_parser::FaceParsingError) -> Self {
Error::FontOrText(text::Error::FaceParsingError(err))
}
}
// impl From<ttf_parser::FaceParsingError> for Error {
// fn from(err: ttf_parser::FaceParsingError) -> Self {
// Error::FontOrText(text::Error::FaceParsingError(err))
// }
// }

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
3 changes: 2 additions & 1 deletion text/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
use std::fmt;

use plotive_base::geom;
use ttf_parser as ttf;
/// Publicly re-export ttf-parser, so that users of this crate can use it for custom font loading and parsing.
pub use ttf_parser as ttf;

mod bidi;
pub mod font;
Expand Down
4 changes: 2 additions & 2 deletions text/src/rich/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn render_rich_text_with<C, RenderFn>(
text: &RichText<C>,
fontdb: &fontdb::Database,
mut render_fn: RenderFn,
) -> Result<(), ttf::FaceParsingError>
) -> Result<(), crate::Error>
where
C: Clone,
RenderFn: FnMut(RichPrimitive<'_, C>),
Expand Down Expand Up @@ -100,7 +100,7 @@ pub fn render_rich_text(
transform: geom::Transform,
mask: Option<&tiny_skia::Mask>,
pixmap: &mut tiny_skia::PixmapMut<'_>,
) -> Result<(), ttf::FaceParsingError> {
) -> Result<(), crate::Error> {
let render_fn = |primitive: RichPrimitive| match primitive {
RichPrimitive::Fill(path, color) => {
let mut paint = tiny_skia::Paint::default();
Expand Down
Loading