View Single Post
Old 03-25-2020, 05:52 AM   #1
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
Posts: 312
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
font size problem calibre viewer, editor, content-server with non-resizing SVG text

[code]
<p>Normally, text resizes when you increase/decrease font. Normally, as you increase/decrease the viewing window text will NOT resize but will reflow. Text will reflow and not resize if you change the number of columns on screen.</p>

<p>By adding an SVG wrapper to some text you prevent that text from reflowing. It will conform to its viewBox. It now shrinks and grows just like an image. If you view with, say, five columns, the image and SVG text are tiny. If you view it in, say, two columns, the image and SVG text is large.</p>

<ol style="border: 1px black solid; border-radius:10px; background-color:gray; padding: .25em; ">

<svg xmlns="http://www.w3.org/2000/svg" preserve="" aspectratio="xMinYMin" viewBox="0 0 100 65">
<foreignObject width="100" height="100" >
<div xmlns="http://www.w3.org/1999/xhtml" style="font-size:.1em">By adding an SVG wrapper to some text you prevent that text from reflowing. It will conform to its viewBox. It now shrinks and grows just like an image. If you view with, say, five columns, the image and SVG text are tiny. If you view it in, say, two columns, the image and SVG text is large.</div>
</foreignObject>
</svg>

</ol>

<p style="background-color:khaki">OL wrapper around SVG-nonresizing-text. The OL wrapper has a gray background-color, 1px border, border-radius of 10px, and .25em padding.</p>

<p style="background-color: pink">This same behavior can be achieved by converting the text to an image. You would do this by screen-shot and saving the text so captured as a .png file. The disadvantage of doing this keeps the text letters from being crisp. Nor is that kind of text searchable because it is no longer real text, just a pattern of dots.</p>

<p>There is a disparity between calibre's editor viewer, calibre's regular viewer, and calibre's content server viewer regarding the SVG's font-size. By trial and error, I set font-size to 1/10th em. It shows full-size in calibre's editor viewer, correctly in the regular viewer, and way-too-small in the content server viewer. I cannot account for it.</p>
[code]

best regards, Pop
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2020-03-25 04-44-41.png
Views:	311
Size:	372.9 KB
ID:	177895   Click image for larger version

Name:	Screenshot from 2020-03-25 04-44-32.png
Views:	286
Size:	312.7 KB
ID:	177896   Click image for larger version

Name:	Screenshot from 2020-03-25 04-43-45.png
Views:	244
Size:	234.5 KB
ID:	177897  
rjwse@aol.com is online now   Reply With Quote