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

This svg file, there is a problem #270

Open
1 task
chengang151 opened this issue Jun 17, 2023 · 3 comments
Open
1 task

This svg file, there is a problem #270

chengang151 opened this issue Jun 17, 2023 · 3 comments

Comments

@chengang151
Copy link

This svg cannot be scaled up;Some elements are displayed incorrectly。

/

@BigBadaboom
Copy link
Owner

Hi @chengang151

The reason this does not work is because it uses the CSS property baseline-shift. This CSS property is not yet supported by AndroidSVG. Even Firefox does not support it yet.

There is a workaround however. You can do your superscripts another way, that will work on all browsers and should work on AndroidSVG also. Change the <text> element from:

<text xmlns="http://www.w3.org/2000/svg" font-size="36" fill="#464646" transform="translate(286 344)">4d<tspan
style="baseline-shift: super; font-size: 0.67em;">7</tspan>5s<tspan 
style="baseline-shift: super; font-size: 0.67em;">1</tspan></text>

to

<text xmlns="http://www.w3.org/2000/svg" font-size="36" fill="#464646" transform="translate(286 344)">4d<tspan
y="-0.33em" style="font-size: 0.67em;">7</tspan><tspan y="0">5s</tspan><tspan y="-0.33em" 
style="font-size: 0.67em;">1</tspan></text>

Hopefully they are your files, and you are able to change them yourself.

Paul

@chengang151
Copy link
Author

Thanks for your reply, problem solved;But why can't this svg picture be enlarged? After changing the width and height, the picture is not enlarged.

@BigBadaboom
Copy link
Owner

For an SVG to scale, it needs to have a viewBox. See these FAQ answers for an explanation, and some solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants