Knowledge (XXG)

:How to draw SVG circuits using Xcircuit - Knowledge (XXG)

Source 📝

17: 327:
in the same directory. Now open the new file with Inkscape to add the text. For the text in the picture on the top, I used font family Serif (you can choose it, whichever OS you are working on), font weight Bold, size 72px. Then I made the subscripts smaller, using the same font style, changing only
348:" to generate the SVG output. The SVG format uses the subset of the format that is implemented in the Mozilla Firefox browser. Because the SVG format does not allow in-line raster images, all raster graphics are dumped to separate files in PNG format (this only works if the ImageMagick 43:
cannot export in SVG straight away, but the format it uses to save data (PostScript) is a vectorial format, so it can be converted to SVG. These are the steps I followed to create the picture on the right.
34:
Obsolete – Inkscape can import Postscript directly (using pstoedit for the conversion) and pstoedit can convert from Postscript directly to svg using the plot-svg output filter.
84:
and we want to convert it to SVG. Working under Linux, here is a small Bash script that will do everything by itself. Open any text editor and put the following code into it:
372: 314:
Check if you have all the necessary programs. In particular you will need Sketch; if you use Debian/Ubuntu, there is everything in the standard repositories.
328:
the size to 56px. Optionally you can actually move the subscripts downwards pressing Alt+down, but sometimes it is not rendered properly by Knowledge (XXG).
366: 341:
from the menu. This will generate an output file of the same name as the page label with the extension '.svg'. You can also use the console to type "
392: 77:
after several tests, but I think it would be better to make all the circuits with this scale, in order to get a uniform output.
361: 387: 16: 335:
can output a single page directly as a .svg file. Starting with version 3.6.156, choose
299:# You can also make the whole thing a big long pipe and eliminate the use of tmp files. 381: 48:
Create the circuit with Xcircuit without any text (we'll add it later). Then go to
373:
Knowledge (XXG):WikiProject Electronics/Programs § Programs for drawing circuits
26:
This how-to is Linux-based. If you can do it for any other OS, please improve it
332: 40: 308:
and make it executable running the following command on the terminal:
15: 53:. In the window that comes up, write the name of the file in the 20:Negative impedance converter drawn with Xcircuit 367:Knowledge (XXG):Modular electronics schematics 93:# you need gs-common, pstoedit and skencil to 8: 7: 362:Knowledge (XXG):Graphics tutorials 352:tool is available on the system). 14: 1: 61:, than change the scale from 409: 96:# get this script working 323:and you will get a nice 87: 393:WikiProject Electronics 388:Knowledge (XXG) how-to 304:save it with the name 21: 320:./ps2svg.sh filename 73:again. I have chosen 19: 311:chmod a+x ps2svg.sh 227:# Convert to Sketch 175:# Fix bounding box 22: 331:As of July 2009, 317:Now you can run: 57:box and click on 51:Write Xcircuit PS 400: 300: 296: 293: 290: 287: 284: 280: 277: 274: 271: 268: 264: 263:# Convert to SVG 260: 257: 254: 251: 248: 244: 241: 238: 235: 232: 228: 224: 221: 218: 215: 212: 208: 205: 202: 199: 196: 192: 189: 186: 183: 180: 176: 172: 169: 166: 163: 160: 157: 154: 151: 148:eps2eps-dNOCACHE 147: 144: 141: 138: 135: 132: 129: 126: 122: 119: 116: 113: 110: 106: 103: 100: 97: 94: 91: 408: 407: 403: 402: 401: 399: 398: 397: 378: 377: 358: 321: 312: 302: 301: 298: 294: 291: 288: 285: 282: 278: 275: 272: 269: 266: 262: 258: 255: 252: 249: 246: 242: 239: 236: 233: 230: 226: 222: 219: 216: 213: 210: 206: 203: 200: 197: 194: 190: 187: 184: 181: 178: 174: 170: 167: 164: 161: 158: 155: 152: 149: 146:# Outline fonts 145: 142: 139: 136: 133: 130: 127: 124: 120: 117: 114: 111: 108: 104: 101: 98: 95: 92: 89: 12: 11: 5: 406: 404: 396: 395: 390: 380: 379: 376: 375: 370: 364: 357: 354: 319: 310: 88: 86: 85: 80:now we have a 78: 38: 37: 29: 28: 13: 10: 9: 6: 4: 3: 2: 405: 394: 391: 389: 386: 385: 383: 374: 371: 368: 365: 363: 360: 359: 355: 353: 351: 347: 344: 340: 334: 329: 326: 318: 315: 309: 307: 83: 79: 76: 72: 69:and click on 68: 64: 60: 56: 52: 47: 46: 45: 42: 36: 35: 31: 30: 27: 24: 23: 18: 349: 345: 342: 338:Export-: --> 336: 330: 325:filename.svg 324: 322: 316: 313: 305: 303: 229:pstoedit-fsk 90:#!/bin/sh -e 81: 74: 70: 66: 62: 58: 54: 49: 39: 33: 32: 25: 369:(abandoned) 225:.ps2svg.ps 173:.ps2svg.ps 82:filename.ps 50:File -: --> 382:Categories 337:File-: --> 193:.ps2svg.ps 306:ps2svg.sh 265:skconvert 356:See also 346:filename 333:Xcircuit 289:BASENAME 273:BASENAME 253:BASENAME 237:BASENAME 217:BASENAME 201:BASENAME 185:BASENAME 165:BASENAME 137:BASENAME 128:BASENAME 107:basename 99:BASENAME 55:Filename 41:Xcircuit 350:convert 177:ps2epsi 67:5.00000 63:1.00000 209:.ps rm 297:.svg 71:Apply 59:Apply 261:.sk 121:echo 343:svg 339:SVG 286:$ { 281:.sk 270:$ { 250:$ { 245:.ps 234:$ { 214:$ { 198:$ { 182:$ { 162:$ { 153:$ 1 134:$ { 112:$ 1 105:$ ( 65:to 384:: 140:%x 295:" 292:} 283:" 279:" 276:} 267:" 259:" 256:} 247:" 243:" 240:} 231:" 223:" 220:} 211:" 207:" 204:} 195:" 191:" 188:} 179:" 171:" 168:} 159:" 156:" 150:" 143:} 131:= 125:) 123:x 118:; 115:" 109:" 102:= 75:5

Index


Xcircuit
Xcircuit
Knowledge (XXG):Graphics tutorials
Knowledge (XXG):Modular electronics schematics
Knowledge (XXG):WikiProject Electronics/Programs § Programs for drawing circuits
Categories
Knowledge (XXG) how-to
WikiProject Electronics

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.