Skip to content

Conversation

naitoh
Copy link
Owner

@naitoh naitoh commented Dec 25, 2023

add SVG image Support

Method ImageSVG() was added to embedd SVG images (see example n. 6, 39, 58), using REXML for XML parsing.
Note that not all SVG images are supported.

List of confirmed SVG files.

List of unsupported SVG files

@naitoh naitoh marked this pull request as draft December 25, 2023 13:40
@naitoh naitoh force-pushed the add_support_svg_image branch 2 times, most recently from 10b1ee0 to a9f23c3 Compare December 25, 2023 14:40
@naitoh naitoh changed the title Add support svg image add SVG image Support Dec 25, 2023
@naitoh naitoh force-pushed the add_support_svg_image branch 4 times, most recently from f9dab11 to 55b39b8 Compare December 29, 2023 14:32
@naitoh naitoh marked this pull request as ready for review December 30, 2023 12:59
@naitoh naitoh force-pushed the add_support_svg_image branch from 55b39b8 to 3aade41 Compare May 5, 2025 20:30
@naitoh naitoh force-pushed the add_support_svg_image branch from 3aade41 to 21403a3 Compare May 6, 2025 03:01
naitoh added 17 commits May 6, 2025 12:24
Method ImageSVG() was added to embedd SVG images (see example n. 6, 39, 58). Note that not all SVG images are supported.
- Filter attribute are not supported.
  See: https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Filter_effects
Separated svg tag parsing into parse_svg_tag_attributes method.
Changed to use rexml pullparser instead of regular expressions.
Separated the parsing of SVG style properties into the get_styling_properties method.
…t-anchor.

[note] text-anchor takes precedence over align.
* 'start' : dx = @c_margin
                                     x=0
                                     |------------------------------------w------------------------------------|
                                     |@c_margin|----------width---------|
                                               ABCDEFGHIJKLMNOPQRSTUVWXYZ (LTR)
                                               ZYXWVUTSRQPONMLKJIHGFEDCBA (RTL)
* 'middle': dx = -width / 2.0
                                     x=0
                         |--width/2--|
                         |---------width----------|
                         ABCDEFGHIJKLMNOPQRSTUVWXYZ (LTR)
                         ZYXWVUTSRQPONMLKJIHGFEDCBA (RTL)
* 'end' : dx = - width - @c_margin
                                     x=0
                           |@c_margin|
  |----------width---------|
  ABCDEFGHIJKLMNOPQRSTUVWXYZ (LTR)
  ZWXWVUTSRQPONMLKJIHGFEDCBA (RTL)
…le_outLine_style={}, circle_fill_color=[]

- Rect,RoundedRect,RoundedRect
- Curve,Ellipse,Circle
- PolyLine,Polygon,Polygon,RegularPolygon,StarPolygon
@naitoh naitoh force-pushed the add_support_svg_image branch from 21403a3 to b2d2e91 Compare May 6, 2025 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant