On Wednesday, 24 May 2023, 05:49:00 BST, Werner LEMBERG <[email protected]> wrote:
> > I finished adding the color toggle to ftgrid (trivial, just cut and
> > paste a few lines from ftview)
> Please submit a Merge Request!
Could we do it the old-fashioned way ("git format-patch" on one side, "git am"
on the other)? Don't know when I'd get my freedesktop gitlab registration
back... attached.
Do you want the other one below about large memory allocated for bitmaps? For
now this seems to do it (without breaking adobe-made/sourced svg fonts) , but
until we see more svg fonts, we aren't sure. I think we probably should put a
stop on insanely large bitmaps (e.g. doing 12000x15000 instead of 12x15)
anyway, elsewhere.
Hin-Tak
src/rsvg-port.c line 255-ish:
===
/* Scale factors from SVG coordinates to the needed output size. */
x_svg_to_out = (double)metrics.x_ppem / dimension_svg.width;
y_svg_to_out = (double)metrics.y_ppem / dimension_svg.height;
+ if ((out_has_viewbox != TRUE) &&
+ (((int)out_width.length == 1) && ((int)out_height.length == 1))) {
+ x_svg_to_out /= units_per_EM;
+ y_svg_to_out /= units_per_EM;
+ }
+
/*
* Create a cairo recording surface. This is done for two reasons.
* Firstly, it is required to get the bounding box of the final drawing
===From 623571db67063fb36c00c09a41da6b468aef332b Mon Sep 17 00:00:00 2001
From: Hin-Tak Leung <[email protected]>
Date: Wed, 24 May 2023 13:48:51 +0100
Subject: [PATCH] [ftgrid] Copy toggles for color and color-layered glyphs,
from ftview
* src/ftgrid.c (Process_Event): Use key `c' to toggle color support,
and key `z' to toggle color-layered glyph usage.
(write_header): Updated.
Based on earlier changes in ftview.
Signed-off-by: Hin-Tak Leung <[email protected]>
---
src/ftgrid.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/ftgrid.c b/src/ftgrid.c
index 368d0aa..6a22914 100644
--- a/src/ftgrid.c
+++ b/src/ftgrid.c
@@ -882,8 +882,11 @@
grWriteln( " hinting (if hinting) " );
grWriteln( "G toggle grid display if Multiple Master or GX font: " );
grWriteln( "C change color palette F2 cycle through axes " );
- grWriteln( " F3, F4 adjust current axis by " );
- grWriteln( "F5, F6 cycle through 1/50 of its range " );
+ grWriteln( "c toggle coloured bitmaps F3, F4 adjust current axis by " );
+ grWriteln( "z toggle colour-layered 1/50 of its range " );
+ grWriteln( " glyphs " );
+ grWriteln( " " );
+ grWriteln( "F5, F6 cycle through " );
grWriteln( " anti-aliasing modes " );
grWriteln( "L cycle through LCD P print PNG file " );
grWriteln( " filters q, ESC quit ftgrid " );
@@ -1449,6 +1452,16 @@
}
break;
+ case grKEY( 'c' ):
+ handle->use_color = !handle->use_color;
+ FTDemo_Update_Current_Flags( handle );
+ break;
+
+ case grKEY( 'z' ):
+ handle->use_layers = !handle->use_layers;
+ FTDemo_Update_Current_Flags( handle );
+ break;
+
case grKEY( 'L' ):
event_lcd_filter_change();
break;
--
2.40.1