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: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ wgpu-26 = { package = "wgpu", version = "26", default-features = false }
wgpu-27 = { package = "wgpu", version = "27", default-features = false }
input = { version = "0.9.0", default-features = false }
tr = { version = "0.1", default-features = false }
fontique = { version = "0.5.0" }
fontique = { version = "0.6.0" }

[profile.release]
lto = true
Expand Down
9 changes: 3 additions & 6 deletions internal/backends/qt/qt_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ impl GlyphRenderer for QtItemRenderer<'_> {

fn draw_glyph_run(
&mut self,
font: &sharedparley::parley::Font,
font: &sharedparley::parley::FontData,
font_size: f32,
brush: Self::PlatformBrush,
y_offset: sharedparley::PhysicalLength,
Expand All @@ -1080,10 +1080,7 @@ impl GlyphRenderer for QtItemRenderer<'_> {
let (glyph_indices, positions): (Vec<u32>, Vec<qttypes::QPointF>) = glyphs_it
.into_iter()
.map(|g| {
(
g.id as u32,
qttypes::QPointF { x: g.x as f64, y: g.y as f64 + y_offset.get() as f64 },
)
(g.id, qttypes::QPointF { x: g.x as f64, y: g.y as f64 + y_offset.get() as f64 })
})
.unzip();

Expand Down Expand Up @@ -1180,7 +1177,7 @@ impl Default for FontCache {
}

impl FontCache {
pub fn font(&mut self, font: &parley::Font) -> Option<QRawFont> {
pub fn font(&mut self, font: &parley::FontData) -> Option<QRawFont> {
self.fonts
.entry((font.data.id(), font.index))
.or_insert_with(move || {
Expand Down
2 changes: 1 addition & 1 deletion internal/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ unicode-script = { version = "0.5.7", optional = true }
integer-sqrt = { version = "0.1.5" }
bytemuck = { workspace = true, optional = true, features = ["derive"] }
sys-locale = { version = "0.3.2", optional = true }
parley = { version = "0.5.0", optional = true }
parley = { version = "0.6.0", optional = true }

image = { workspace = true, optional = true, default-features = false }
clru = { workspace = true, optional = true }
Expand Down
18 changes: 9 additions & 9 deletions internal/core/textlayout/sharedparley.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub trait GlyphRenderer: crate::item_rendering::ItemRenderer {
/// given y offset.
fn draw_glyph_run(
&mut self,
font: &parley::Font,
font: &parley::FontData,
font_size: f32,
brush: Self::PlatformBrush,
y_offset: PhysicalLength,
Expand Down Expand Up @@ -238,7 +238,7 @@ fn layout(text: &str, scale_factor: ScaleFactor, options: LayoutOptions) -> Layo
max_physical_width.map(|width| width.get()),
match options.horizontal_align {
TextHorizontalAlignment::Left => parley::Alignment::Left,
TextHorizontalAlignment::Center => parley::Alignment::Middle,
TextHorizontalAlignment::Center => parley::Alignment::Center,
TextHorizontalAlignment::Right => parley::Alignment::Right,
},
parley::AlignmentOptions::default(),
Expand Down Expand Up @@ -315,7 +315,7 @@ impl Layout {
default_stroke_brush: Option<<R as GlyphRenderer>::PlatformBrush>,
draw_glyphs: &mut dyn FnMut(
&mut R,
&parley::Font,
&parley::FontData,
f32,
<R as GlyphRenderer>::PlatformBrush,
&mut dyn Iterator<Item = parley::layout::Glyph>,
Expand Down Expand Up @@ -547,8 +547,8 @@ pub fn draw_text_input(
item_renderer.fill_rectangle(
PhysicalRect::new(
PhysicalPoint::from_lengths(
PhysicalLength::new(rect.min_x() as _),
PhysicalLength::new(rect.min_y() as _) + layout.y_offset,
PhysicalLength::new(rect.x0 as _),
PhysicalLength::new(rect.y0 as _) + layout.y_offset,
),
PhysicalSize::new(rect.width() as _, rect.height() as _),
),
Expand Down Expand Up @@ -577,8 +577,8 @@ pub fn draw_text_input(
item_renderer.fill_rectangle(
PhysicalRect::new(
PhysicalPoint::from_lengths(
PhysicalLength::new(rect.min_x() as _),
PhysicalLength::new(rect.min_y() as _) + layout.y_offset,
PhysicalLength::new(rect.x0 as _),
PhysicalLength::new(rect.y0 as _) + layout.y_offset,
),
PhysicalSize::new(rect.width() as _, rect.height() as _),
),
Expand Down Expand Up @@ -691,8 +691,8 @@ pub fn text_input_cursor_rect_for_byte_offset(
let rect = cursor.geometry(&layout.inner, (text_input.text_cursor_width()).get());
PhysicalRect::new(
PhysicalPoint::from_lengths(
PhysicalLength::new(rect.min_x() as _),
PhysicalLength::new(rect.min_y() as _) + layout.y_offset,
PhysicalLength::new(rect.x0 as _),
PhysicalLength::new(rect.y0 as _) + layout.y_offset,
),
PhysicalSize::new(rect.width() as _, rect.height() as _),
) / scale_factor
Expand Down
2 changes: 1 addition & 1 deletion internal/renderers/femtovg/font_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl Default for FontCache {
}

impl FontCache {
pub fn font(&mut self, font: &parley::Font) -> femtovg::FontId {
pub fn font(&mut self, font: &parley::FontData) -> femtovg::FontId {
let text_context = self.text_context.clone();

*self.fonts.entry((font.data.id(), font.index)).or_insert_with(move || {
Expand Down
4 changes: 2 additions & 2 deletions internal/renderers/femtovg/itemrenderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ impl<'a, R: femtovg::Renderer + TextureImporter> GlyphRenderer for GLItemRendere

fn draw_glyph_run(
&mut self,
font: &parley::Font,
font: &parley::FontData,
font_size: f32,
mut brush: Self::PlatformBrush,
y_offset: sharedparley::PhysicalLength,
Expand All @@ -971,7 +971,7 @@ impl<'a, R: femtovg::Renderer + TextureImporter> GlyphRenderer for GLItemRendere
let glyphs_it = glyphs_it.map(|glyph| femtovg::PositionedGlyph {
x: glyph.x,
y: glyph.y + y_offset.get(),
glyph_id: glyph.id,
glyph_id: glyph.id as u16,
});

let mut canvas = self.canvas.borrow_mut();
Expand Down
2 changes: 1 addition & 1 deletion internal/renderers/skia/font_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl Default for FontCache {
}

impl FontCache {
pub fn font(&mut self, font: &parley::Font) -> Option<skia_safe::Typeface> {
pub fn font(&mut self, font: &parley::FontData) -> Option<skia_safe::Typeface> {
self.fonts
.entry((font.data.id(), font.index))
.or_insert_with(|| {
Expand Down
2 changes: 1 addition & 1 deletion internal/renderers/skia/itemrenderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ impl GlyphRenderer for SkiaItemRenderer<'_> {

fn draw_glyph_run(
&mut self,
font: &sharedparley::parley::Font,
font: &sharedparley::parley::FontData,
font_size: f32,
brush: Self::PlatformBrush,
y_offset: sharedparley::PhysicalLength,
Expand Down
Loading