kartsims / easysvg Goto Github PK
View Code? Open in Web Editor NEWGenerate SVG definitions and XML using PHP
Generate SVG definitions and XML using PHP
I'm wondering about the license of the included font file. I only found this website: https://www.fonts.com/font/la-goupil/paris/bold - it seems the font is non-free?
I'd kindly ask if there's an easy way to create curved/bended text like arc 4%?
I wonder if there is a way to resize the SVG to match its content only. Right now I have a difference between the height of the SVG tag, and the height of the path within this SVG:
The font in this example is transformed in a single path, not embed font.
My php code:
$svg = new EasySVG();
$svg->setFontSVG($svgFont->filename);
$svg->setFontSize(100);
$svg->setFontColor('#000000');
$svg->setLineHeight(0);
$svg->setUseKerning(true);
$svg->addText($demoText);
list($textWidth, $textHeight) = $svg->textDimensions($demoText);
$svg->addAttribute("viewbox", "0 0 $textWidth $textHeight");
$svg->addAttribute("width", $textWidth."px");
$svg->addAttribute("height", $textHeight."px");
$svg->addAttribute("preserveAspectRatio","none");
Could be related to #23
Hi there,
sorry for get in touch with you via this way.
I'm using this awesome library for generating a path with text. Is it possible to manipulate the created path for example mirroring text, aligning text or changing the ratio?
Thank you.
Danny
Hello
I've read on the stackoverflow-page that you want to know what features you could integrate into this nice project. I would say that the most needed feature would be a bounding box like the GD Lib offers for Fonts, so I know how big of a box my String will generate at the given Fontsize and with a given font. Also: Linebreak :)
Best wishes
Mortimer
I am trying to vertically align text, but its definitely off. When I look at your textDimensions method I am a little confused on exactly what this calculation does:
$lineHeight = ( $this->font->ascent + $this->font->descent ) * $fontSize * 2;
Is this really getting the line height of the text? The ascent usually comes in as a positive number, and the descent a negative number. 1 + -1 = 0, how is this measuring distance? Could this be related to to the vertical centering issue?
You could probably just move your additions from 08b308d to after the $letter==10
check to see if it's a newline.
It is possible to placed the svg horizontal und vertical to zero? When yes, how?
-----------------
|This IS A TEXT
|
The Box of "This IS A TEXT" should to zero of x and y positition.
Greetings
Sebastian
Provide option for letter spacing between characters
It would be nice if the resulting SVG could be optimized.
Here is an example of a Python / Javascript optimization library that lets you specify the decimal levels for paths.
I have noticed that when resize the svg displayed on webpage with css height weight defined it does not reduced the svg display size but show half part of it instead ( shows partial svg ) . Is there something can be done to output
We'd like to use your libary and it would greatly help us if you could tag a (stable) version.
Hi there, i will use your paths inside a common svg container. I need to center the text. Can i generate the svg with 100% height and width and then center the text inside?
Thank you for sharing nice script. I just wonder how about the font style?
Thank you.
Calvin
Provide ability to inject custom ID or class to each line of text (path)
For example it would be nice to create an id for the SVG #myfirstsvg
and then each path have an id #line-1 #line-2 #line-3
This would allow better flexibility when working with the SVG using Javascript
Fatal error: EasySVG->defScale(NULL, 0.048828125, -0.048828125)
So probably missing glyph. A workaround would be - if I knew - to just look for unicode 32 or 13, and then just add a manual spacing.
If I knew how, I'd probably add this myself, too :D
cu, w0lf.
Not sure if anyone would be interested in doing this or not, but I thought someone might have some appetite for doing something like this with easysvg.
https://github.com/jimblackler/treefun
http://jimblackler.net/blog/?p=365
http://jimblackler.net/treefun/
It could prove an interesting set of sample code -- and an add-on utility that folks might leverage.
kerning is not supported
Hi
I can generate the SVG image using easySVG. Is it possible to add a background image to the generated CSV. I tried to add a background image in the style attribute but it is not working.
Please suggest how I can do it.
Thanks
I've downloaded different font files from https://google-webfonts-helper.herokuapp.com/fonts and used the svg-font-file from the archive. But the result is not the expected one. I can read the text only very hardly.
Could you please explain, where or how to get usable font-files for the class? The included svg-font works as expected, but I need another font.
can not use google font
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.