Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add SVG image Support #97

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

add SVG image Support #97

wants to merge 18 commits into from

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 2 times, most recently from 4f2d879 to c6bf63d Compare December 28, 2023 03:25
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.
@naitoh naitoh force-pushed the add_support_svg_image branch from c6bf63d to f9dab11 Compare December 29, 2023 04:31
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 f9dab11 to 55b39b8 Compare December 29, 2023 14:32
@naitoh naitoh marked this pull request as ready for review December 30, 2023 12:59
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