8000 PNG image support via patterns by mikrosk · Pull Request #1 · mtyberg/nanosvg · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PNG image support via patterns #1

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

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

PNG image support via patterns #1

wants to merge 4 commits into from

Conversation

mikrosk
Copy link
@mikrosk mikrosk commented Sep 23, 2019

This code has been adapted from https://sourceforge.net/p/cloverefiboot/code/HEAD/tree/rEFIt_UEFI/libeg, I'm not sure how much easier would be to add a proper PNG support but this was pretty straightforward and most importantly, it works. :)

8000

The simplest test case looks like this:

<?xml version="1.0" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="20.4853cm" height="5.42229cm" viewBox="2188.37 2966.24 512.131 135.557" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" >
	<defs>
	<pattern width="1.0" height="1.0" id="pattern0" >
		<image xlink:href="map_smalltree_ca.png" />
	</pattern>
	</defs>
	<rect x="2364.11" y="3095.95" width="3" height="3" style="fill:url(#pattern0)" />
</svg>

where map_smalltree_ca.png is a file located in the folder specified in nsvgParse.

You need libpng installed as a dependency.

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
0