mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-20 11:28:30 +08:00
Add String[] as a graphic type for typography (#4141)
* feat: Render List<String> as raw paths in SVG and Vell mode * chore: code review * chore: change the hardcoded layout bounds to parley's * chore: code review * feat: Split text node to text_layer and text_to_vector node * fix: CI fail because of difference in nature of Mac and github action * chore: fix * chore: replace FontStack as it got removed in parley 0.9 * chore: fmt * chore: migrate the rendering as of new resource architechture * chore: add text_layer node to text tool for testing * code review * Make boolean ops support the Text type * chore: Move fallback_font_resource authority from editor to text node * Fix 'Text Layer' node missing font dropdown * Change node doc comments from Vec<T> to T[] * Add migrations from the old Text node to Text -> Text to Vector * Consolidate * Rename the text attributes and reorder tilt to come before max_width/height * Detect legacy Text nodes in the split migration by their trailing separate_glyphs input * Code review * Frame Text layer thumbnails by laying out their text for bounds * Give Text layers click targets and selection outlines via collect_metadata * Route Text tool through Text to Vector with fill, fixing editing-preview placement --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
13abf9fa8c
commit
5f100946f2
@@ -53,6 +53,11 @@ impl MultiplyAlpha for List<GradientStops> {
|
||||
multiply_list_attribute(self, ATTR_OPACITY, factor);
|
||||
}
|
||||
}
|
||||
impl MultiplyAlpha for List<String> {
|
||||
fn multiply_alpha(&mut self, factor: f64) {
|
||||
multiply_list_attribute(self, ATTR_OPACITY, factor);
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) trait MultiplyFill {
|
||||
fn multiply_fill(&mut self, factor: f64);
|
||||
@@ -87,6 +92,11 @@ impl MultiplyFill for List<GradientStops> {
|
||||
multiply_list_attribute(self, ATTR_OPACITY_FILL, factor);
|
||||
}
|
||||
}
|
||||
impl MultiplyFill for List<String> {
|
||||
fn multiply_fill(&mut self, factor: f64) {
|
||||
multiply_list_attribute(self, ATTR_OPACITY_FILL, factor);
|
||||
}
|
||||
}
|
||||
|
||||
trait SetBlendMode {
|
||||
fn set_blend_mode(&mut self, blend_mode: BlendMode);
|
||||
@@ -123,6 +133,11 @@ impl SetBlendMode for List<GradientStops> {
|
||||
set_list_blend_mode(self, blend_mode);
|
||||
}
|
||||
}
|
||||
impl SetBlendMode for List<String> {
|
||||
fn set_blend_mode(&mut self, blend_mode: BlendMode) {
|
||||
set_list_blend_mode(self, blend_mode);
|
||||
}
|
||||
}
|
||||
|
||||
trait SetClip {
|
||||
fn set_clip(&mut self, clip: bool);
|
||||
@@ -159,6 +174,11 @@ impl SetClip for List<GradientStops> {
|
||||
set_list_clip(self, clip);
|
||||
}
|
||||
}
|
||||
impl SetClip for List<String> {
|
||||
fn set_clip(&mut self, clip: bool) {
|
||||
set_list_clip(self, clip);
|
||||
}
|
||||
}
|
||||
|
||||
/// Applies the blend mode to the input graphics. Setting this allows for customizing how overlapping content is composited together.
|
||||
#[node_macro::node(category("Blending"))]
|
||||
@@ -171,6 +191,7 @@ fn blend_mode<T: SetBlendMode>(
|
||||
List<Raster<CPU>>,
|
||||
List<Color>,
|
||||
List<GradientStops>,
|
||||
List<String>,
|
||||
)]
|
||||
mut content: T,
|
||||
/// The choice of equation that controls how brightness and color blends between overlapping pixels.
|
||||
@@ -194,6 +215,7 @@ fn opacity<T: MultiplyAlpha + MultiplyFill>(
|
||||
List<Raster<CPU>>,
|
||||
List<Color>,
|
||||
List<GradientStops>,
|
||||
List<String>,
|
||||
)]
|
||||
mut content: T,
|
||||
/// Whether the *Opacity* property is enabled, multiplying the existing opacity by the chosen percentage.
|
||||
@@ -235,6 +257,7 @@ fn clipping_mask<T: SetClip>(
|
||||
List<Raster<CPU>>,
|
||||
List<Color>,
|
||||
List<GradientStops>,
|
||||
List<String>,
|
||||
)]
|
||||
mut content: T,
|
||||
/// Whether the content inherits the alpha of the content beneath it.
|
||||
|
||||
Reference in New Issue
Block a user