Thread: svg
View Single Post
Old 07-11-2023, 08:03 PM   #13
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,624
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by RbnJrg View Post
Just open the svg as a file (File -> Open...) But first style inline your text, otherwise, the text will show very tiny on Inkscape.
I have inline styled that page...
Spoiler:
Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">

<head>
  <title>The Fourth K</title>
  <link type="text/css" rel="stylesheet" href="OEBPS/stylesheet.css"/>
</head>

<body>

  <svg width="1200" height="1600" version="1.1" viewBox="0 0 1200 1600" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg">

    <rect x="10" y="0" width="20" height="1600" stroke="black" fill="black" stroke-width="5"/>
    <rect x="50" y="0" width="20" height="1600" stroke="black" fill="black" stroke-width="5"/>
    <rect x="90" y="0" width="20" height="1600" stroke="black" fill="black" stroke-width="5"/>

    <text x="150" y="200" style="font-family: Pistilli, serif; font-size: 2em; font-weight: bold; text-align: center; text-indent: 0;">MARIO</text>
    <text x="150" y="240" style="font-family: Pistilli, serif; font-size: 2em; font-weight: bold; text-align: center; text-indent: 0;">PUZO</text>
    <line x1="150" x2="300" y1="250" y2="250" stroke="black" stroke-width="5"/>
    <text x="150" y="290" style="font-family: Pistilli, serif; font-size: 2em; font-weight: bold; text-align: center; text-indent: 0;">THE</text>
    <text x="150" y="330" style="font-family: Pistilli, serif; font-size: 2em; font-weight: bold; text-align: center; text-indent: 0;">FOURTH</text>
    <text x="150" y="400" style="font-family: Pistilli, serif; font-size: 5em; font-weight: bold; text-align: center; text-indent: 0;">K</text>

    <image href="OEBPS/images/random_house.png" x="150" y="550" width="50" height="50"/>
    <text x="150" y="610" class="sans">RANDOM HOUSE</text>
    <text x="150" y="625" class="sans">NEW YORK</text>

  </svg>
    

</body>
</html>


I am sorry, but I am being a bit obtuse here. My question is "How?" How do I open it in Inkscape?
I have done the File>Open, but what am I opening? There is no option to import the epub. If I save that code to an xml, html or xhtml file, it is not a recognised format, so it doesn't appear in the list. If I save it with .svg extension it says "Failed to open requested file". Copy and paste doesn't work. So what am I opening?

Quote:
Originally Posted by RbnJrg View Post
By the way, you could have designed your svg directly from Inkscape; it's quite easy to do it (simpler than what you made writing the code by hand). In the Help menu you'll find some good tutorials to learn Inkscape (is easy).
Sounds good. Once I can get the hang of it, I think it will come in useful. I'll have to sit down and go through their tutorials.
At the moment I use photoshop and just create whatever images I need, but it will be good to learn more about svg images.


Quote:
Originally Posted by DNSB View Post
Other than the random house logo image not be present, I inlined the svg and imported it into Inkscape. I've attached the output png to this message. I also set the svg to 600x800 and then exported a 1200x1600 png.
Great. Thank you.
Karellen is offline   Reply With Quote