Quote:
Originally Posted by llasram
I'm afraid I don't follow...
|
whoops, I had two examples differentiating the different svg styles, I removed it when it seemed a shorter question could be formed.
Quote:
I assume by "Open Font" you mean "OpenType font." ... so if you need font with particular properties, the only way to ensure they are present is to embed them.
|
Got it, I'll pick a font and embed it.
Quote:
That said, you don't need to use monospace fonts to ensure text alignment. Just construct your SVG so that the numbers are aligned.
As far as I know, you don't. If you need pieces of text placed at particular points, place them there using separate SVG text elements.
|
Actually I do, since my text is mostly math problems and vertical spacing is important. Since I reuse a large portion of my code for 100 odd drawings, I'd rather not retune each piece. For example, if I need a single number or a list of numbers, that would entail figuring out by trial and error the correct x co-ordinate placement. Also I want to be able to read my code without having to view it in another application for every change I make.
I still need a way to preserve whitespace.
Quote:
The XHTML and CSS containing the SVG affects only the placement and size of the box in which the SVG is rendered.
That's actually incorrect. The XHTML doctypes specify only XHTML elements, which means that including SVG elements makes the document invalid. If you're using inline SVG, you can't declare a doctype. As a side-effect this means that you can't use any of the HTML character entities -- just include the characters themselves directly and encode as UTF-8 or UTF-16 (as the EPUB spec requires).
|
Okay, so I've unwittingly included css inside my svg? The whitespace : pre declaration and another html character I'm using (the multiplication sign) are being rendered by Chrome and Safari, but shouldn't in say inkscape or other svg viewers which are not html aware?
Okay nevermind, I shouldn't have omitted my second example since it contains what you stated.
Quote:
You should rarely use pixels for anything -- those are purely a feature of the particular device and its resolution. Use % to specify a proportion of the viewable area or 'pt' to specify an actual physical dimension. For viewBox though, the units are the SVG internal scalable units, and those aren't really related to what happens in actual rendering. You just use viewBox to specify what viewport you want on the drawing, then use the size of the XHTML+CSS rendering box to specify it's actual placement and size in rendering.
|
I think I understand, but am still baffled if I use height and width at 100%, this should take up the entire display area, right? Forgive my lack of terminology, but if percentage is used, then the outcome is determined by taking the original size of what the page is, inherited from <head>, <div>, <table>, or other css element, and then derived to the resulting size.
For example, I'm defining page width as 350px (approximately 65-80 characters as most css documents suggest), then defining a table which has a column width of 60% (now 210px), and finally defining an svg with 50% width, the resulting image should be 105px? Yet, how do I define height, which can be infinite, must I continue to use px or pt?