Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 04-21-2014, 02:32 AM   #1
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 3,200
Karma: 34977896
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
[Tutorial] Convert TEXT to SVG IMAGE with Inkscape

A Mini-tutorial inspired by a Wikimedia article: http://commons.wikimedia.org/wiki/He...t_and_Inkscape


Usually, text is best represented as text, because it enables users to search, copy, and edit.

Sometimes your ebook has text that needs special fonts, such as math equations, foreign language quotations, or even just a fancy display font. But maybe you can't embed that special font because the license won't allow it, or the reading device won't support it.

A Scalable Vector Graphic is the next best thing to the font itself – the image can be scaled large or small with no loss of quality.

Note that not all reader devices/software support SVG.


YOU WILL NEED:
-- Inkscape, a free and open source vector drawing program http://www.inkscape.org/en/ . Get the portable version and you can run it from anywhere.

-- (optional) A text editor to display the text and font you are working with.

--
TIP: You don't always have to install fonts you're working with if you only have a temporary requirement. Most programs, including Inkscape, can utilize fonts that are simply loaded into memory. Load fonts by opening them with the Windows Font Viewer (should be offered on right-click Open With...), or use a font manager with the ability to load them, such as Nexus Font: http://xiles.net/nexusfont/.


THE PROCEDURE:

1.-- LAUNCH INKSCAPE, with a new document.

Note on navigating the editing window:
Mouse wheel scrolls up/down;
SHIFT + Mouse wheel scrolls left/right;
CTRL + mouse wheel zooms the window;
SHIFT + Right-button-drag pans the window.


2.-- CREATE THE TEXT:
-- On the left toolbar, click the large "A" icon, "Create and edit text objects" [or press F8].

-- Click in the editing window, and type or paste desired text.

-- The text should be surrounded by a dotted marquee.
Click image for larger version

Name:	02.png
Views:	2271
Size:	31.4 KB
ID:	121908
(click to enlarge)


3.-- SELECT THE TEXT OBJECT:
If the dotted selection marquee has disappeared after typing, editing, or other mouse activty:
-- Choose menu EDIT -> Select All [or CTRL + A]; this should display the marquee.

Click image for larger version

Name:	03a.png
Views:	2954
Size:	32.6 KB
ID:	121909
(click to enlarge)


4.-- FORMATTING:
(This is a very brief overview of some of the possible formatting; see the Inkscape user's manual for more.)
Remember, to apply formatting; the text must be selected (dotted selection marquee must be visible); use the "Select All" command as needed.

Additionally, you can click and drag to highlight individual words or characters within the selection, and apply specific formatting to the highlighted bits only.

4a.-- SET THE FONT AND FONT-SIZE:
-- Choose menu TEXT -> Text and font... ; or click the large "T" icon on the right-hand toolbar, or press SHIFT + CTRL + T.
Click image for larger version

Name:	04a1.png
Views:	2959
Size:	18.3 KB
ID:	121911
(click to enlarge)

-- The dialog provides formatting options:

-- Use the "Font" tab to choose the desired font name, style, size, alignment, line-height.
-- Use the "Text" tab to edit the actual text (add or delete text, spaces, line feeds).
-- Click "Apply" when ready. (It seems to be a long delay until the "apply" button becomes active; this may be computer-related.)
Click image for larger version

Name:	04a2.png
Views:	1751
Size:	10.5 KB
ID:	121912
(click to enlarge)

4b.-- (optional) Apply fill color:
-- Default colors can be chosen from the pallet at the bottom of the window.
-- To create a custom color: select menu OBJECT -> Fill and stroke, or Shift + Ctrl + F, or click the small "Fill:" field in bottom left corner; then use the Fill tab to create colors. Remember that some shades may be hard to read when they are converted on a grey-scale device.


5.-- (optional) Set the default display size:
For simple text fragments in ebooks, this step should not be necessary, but is included here for informational purposes.

-- With the dotted marquee displayed; at top of the left toolbar, click the "arrow" icon [or F1]. A number of arrow-handles surround the dotted marquee.
Click image for larger version

Name:	03b.png
Views:	1688
Size:	17.3 KB
ID:	121910
(click to enlarge)

-- To resize the text, hold down the "Ctrl" key and drag the handles to resize text as desired. The Ctrl key keeps aspect ratio intact and prevents distortion.
-- To move the object, CTRL + click-and-drag inside the marquee.
Click image for larger version

Name:	05.png
Views:	1391
Size:	12.3 KB
ID:	121913
(click to enlarge)


6.-- RESIZE THE PAGE TO FIT:
--Select menu FILE -> Document Properties... [or SHIFT + CTRL + D].
Click image for larger version

Name:	06a.png
Views:	1731
Size:	28.4 KB
ID:	121914
(click to enlarge)

-- Click the button "Resize page to content..." The caption changes to "Resize page to drawing or selection". Click again to auto-crop the selected text object.
Click image for larger version

Name:	06b.png
Views:	2336
Size:	27.4 KB
ID:	121915
(click to enlarge)


7.-- CONVERT TO PATH:
Choose menu PATH -> Object to Path, [or SHIFT + CTRL + C].
This converts the text object into "paths": the text becomes an image. If you don't do this, readers will only be able to see the SVG properly if they have that font installed.
Click image for larger version

Name:	07.png
Views:	2642
Size:	32.0 KB
ID:	121916
(click to enlarge)


8.-- SAVE THE FILE:
Choose menu FILE -> Save As [or SHIFT + CTRL + S], and save your new svg file with desired filename. To prevent compatibility problems, be sure to save as "Plain SVG", not as "Inkscape SVG".


THE RESULT:
Now you have an SVG image replica of your special text, which can be scaled up and down nicely. Style the <height:> to size in ems, so it will resize in synch with surrounding text.

Vertical alignment of inline images might not line up perfectly smoothly with surrounding text, but neither would any other image, and svg will give a better appearance overall. Try tweaking the "vertical-align:" styling for better results.

The screenshot shows two fragments of Greek text, and a bit of blackletter.
Click image for larger version

Name:	09a.png
Views:	2173
Size:	13.4 KB
ID:	121917
(click to enlarge)


Example code:

Spoiler:
Code:
/* the css*/
/*The div must set centering, not the img class*/

.svgDiv {
padding-top: 0;
padding-bottom: 0;
padding-right: 0;
padding-left: 0;
margin-top: 2.0em;
margin-bottom: 1.0em;
text-indent: 0;
text-align: center;
page-break-inside: avoid;
}
.svgBlock {
height: 2.25em;
max-width: 100%;
}
.svgInline {
vertical-align: bottom;
height: 1.10em;
}

/*the html*/

<p>‘Yet it is not the old imperious god of the fatal bow – <img alt="Erôs anikate machan" class="svgInline" src="../Images/greekA.svg"/> – not that – nor even the placid respectable <img alt="storge" class="svgInline" src="../Images/greekB.svg"/> – but something still unnamed, perhaps more mysterious, more divine! Only one must stoop to see it, old fellow, one must stoop!’</p>

<p>...........................</p>

<p>... and who shall dare to play Rhadamanthus, to appraise the record, and to decide how much of it is solid achievement, and how much the merest child’s play?</p>

<div class="svgDiv">
<img alt="The End" class="svgBlock" id="end00" src="../Images/end00.svg"/>
</div>


================

Ok, all done. I hope you found this useful.

Last edited by GrannyGrump; 11-02-2017 at 07:54 AM.
GrannyGrump is offline   Reply With Quote
Old 04-21-2014, 07:49 AM   #2
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,548
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Congratulations Granny! Very good and perfectly clear all explanations; nothing to add them But in order to your issues to "vertical-align" images, you can get perfect results by setting "percentages" (positives or negatives) as a value for the property. For example:

Code:
.svgInline {
   vertical-align: -0.1%;
   height: 1.10em;
}
You also could try with "vertical-align: text-bottom" instead of "vertical-align: bottom" but in the case you presented practically is the same. Also could be a very good idea to use "pixels" as measurement:

Code:
.svgInline {
   vertical-align: -5px; /* values also can be positives */
   height: 1.10em;
}
But regarding the tutorial you made, just one word: perfect!

Regards
Rubén
RbnJrg is offline   Reply With Quote
Advert
Old 04-21-2014, 12:20 PM   #3
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)


Wow! You've reached the top professional level!
roger64 is offline   Reply With Quote
Old 04-22-2014, 05:38 AM   #4
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 3,200
Karma: 34977896
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
Why, thank you, kind folks, for the compliments!


@Ruben, funny, but I've used percentages with success to adjust alignment on superscripts, but it didn't want to work for me on this little test. I'll give that another try, maybe I wasn't aggressive enough. Would pixels work sizing with ems and the font size set very large or very tiny? I need to play with that a bit.

Thanks for the tips!
GrannyGrump is offline   Reply With Quote
Old 04-25-2024, 04:50 PM   #5
WonderfulNerd
Junior Member
WonderfulNerd began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Apr 2024
Device: kindle
you could also use a online tool like https://prompt2svg.com/
WonderfulNerd is offline   Reply With Quote
Advert
Old 04-25-2024, 06:07 PM   #6
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,099
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
lol
That thread was only 10 years and 3 days old!!
Turtle91 is offline   Reply With Quote
Old 04-26-2024, 08:31 AM   #7
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,166
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
I assume a new poster with one post only and a URL is really some sort of spammer.

Also ANY online tool has privacy & safety issues compared with widely recognised local tools.

The OP is about Inkscape, which is still a good package.
Quoth is offline   Reply With Quote
Old 04-26-2024, 04:09 PM   #8
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,285
Karma: 98804578
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by Quoth View Post
I assume a new poster with one post only and a URL is really some sort of spammer.
But do you report such posts so that a moderator can do something about it?
j.p.s is offline   Reply With Quote
Old 04-26-2024, 04:29 PM   #9
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,104
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Yea, probably a spammer promoting a paid service.
But I am glad this old thread was bumped. I just learnt something new from the OP!!
No need to insert a font file just to display a non-standard symbol or two.
Karellen is online now   Reply With Quote
Old 04-26-2024, 10:08 PM   #10
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,489
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Karellen View Post
Yea, probably a spammer promoting a paid service.
But I am glad this old thread was bumped. I just learnt something new from the OP!!
No need to insert a font file just to display a non-standard symbol or two.
I used this technique a couple of times to insert Enochian text in Terry Pratchett's books (it's the language used by the golems).
DNSB is online now   Reply With Quote
Old Yesterday, 06:54 AM   #11
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,166
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by j.p.s View Post
But do you report such posts so that a moderator can do something about it?
Almost always.
Quoth is offline   Reply With Quote
Old Yesterday, 04:50 PM   #12
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,099
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I just used this! I made a simple svg to look like a wax seal on a letter (like they used to do in the old days). It only took a couple minutes and it made that little section of the book 'pop'. Not at all required, but it was easy, a little bit of fun, and looks better than just a basic 'FJF' !
Attached Thumbnails
Click image for larger version

Name:	fjf.png
Views:	5
Size:	13.3 KB
ID:	207870  
Turtle91 is offline   Reply With Quote
Reply

Tags
inkscape, svg, text conversion, text image, tutorial


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] Bitmap tracing -- Quick & Simple SVG Text Images with Inkscape GrannyGrump Workshop 18 11-05-2015 04:01 PM
Svg wrapper and image resizing Nabodita ePub 24 05-02-2014 12:21 AM
Inkscape SVG Validation Problems doubleshuffle ePub 2 12-20-2013 12:37 AM
Scaling up an image via SVG Kayto ePub 27 01-26-2013 03:38 AM
Image overlayed over text (but text visible if image disabled)? Kaylee Skylyn ePub 5 08-01-2012 05:27 PM


All times are GMT -4. The time now is 01:34 AM.


MobileRead.com is a privately owned, operated and funded community.