Turning a Text List into Inkscape Text Objects

Similar documents
EndNote Class Outline Using EndNote in Microsoft Word 2007

This handout will help you prepare a research paper in the APA 6th Edition format.

EndNote Miscellany. 2 Backing Up an EndNote Library

MODFLOW - Grid Approach

v. 8.0 GMS 8.0 Tutorial MODFLOW Grid Approach Build a MODFLOW model on a 3D grid Prerequisite Tutorials None Time minutes

APA Style Page Formatting Instructions Microsoft Word Windows Version. Adjust all margins to 1 inch on each side, page in Portrait orientation

Editing Reference Types & Styles: Macintosh. EndNote Support & Training October 2017

Tutorial 3 Normalize step-cycles, average waveform amplitude and the Layout program

7thSense Design Delta Media Server

Setting Up the Warp System File: Warp Theater Set-up.doc 25 MAY 04

Written Tutorial and copyright 2016 by Open for free distribution as long as author acknowledgment remains.

BullCharts BullScan Manager a Tutorial

APA Research Paper Chapter 2 Supplement

MICROSOFT WORD FEATURES FOR ARTS POSTGRADUATES

Computer Graphics: Overview of Graphics Systems

J.M. Stewart Corporation 2201 Cantu Ct., Suite 218 Sarasota, FL Stewartsigns.com

Introduction to Endnote X8 Handbook

HOW TO MAKE A TABLE OF CONTENTS

Introduction to Research Department of Metallurgical and Materials Engineering Indian Institute of Technology, Madras

Import and quantification of a micro titer plate image

KRS-V7A Programming Software for the Kenwood TM-V7A

KRAMER ELECTRONICS LTD. USER MANUAL

Pictures To Exe Version 5.0 A USER GUIDE. By Lin Evans And Jeff Evans (Appendix F By Ray Waddington)

AMERICA S CASTLES. 5. Be sure all four margins are set to 1 (Step 1 in the MLA Document).

02 MLA Manuscript Format: The Humanities Standard

Introduction to EndNote Desktop

EndNote X6: the basics (downloadable desktop version)

Impro-Visor. Jazz Improvisation Advisor. Version 2. Tutorial. Last Revised: 14 September 2006 Currently 57 Items. Bob Keller. Harvey Mudd College

Health Sciences Library System University of Pittsburgh. Instructors Andrea Ketchum, MS, MLIS / Patricia Weiss, MLIS /

What's new in EndNote Version 6?

USING ENDNOTE X4: ADVANCED SKILLS

WCS-D800 Programming Software for the Icom ID-800

WCS-V82 Programming Software for the Icom IC-V82

Swinburne University of Technology

2. Document setup: The full physical page size including all margins will be 148mm x 210mm The five sets of margins

Guide to Endnote X7 MID SWEDEN UNIVERSITY TORUN SUNDSTRÖM , UPDATED

EndNote for Windows. Take a class. Background. Getting Started. 1 of 17

Chapter 5 Printing with Calc

Use xtimecomposer and xscope to trace data in real-time

Getting started with Mendeley

London Examinations IGCSE

Handout 1 - Introduction to plots in Matlab 7

Word 4 Activity 1 - Report

EndNote XV (fifteen): the basics (downloadable desktop version)

How to Insert Page Numbers in WORD

Logisim: A graphical system for logic circuit design and simulation

Effective Test Procedures for Installing and Maintaining RF Transmitter Sites

Introduction to EndNote X7

Tutor Led Manual v1.7. Table of Contents PREFACE I.T. Skills Required Before Attempting this Course... 1 Copyright... 2 GETTING STARTED...

Classical simulations with PJNMR BCMB/CHEM LAB 01/25/12

Artistic Licence Engineering Ltd Firmware Version V3.03 Manual Revision V1-9

ConeXus Process Guide

Objectives: Topics covered: Basic terminology Important Definitions Display Processor Raster and Vector Graphics Coordinate Systems Graphics Standards

2 Select the magic wand tool (M) in the toolbox. 3 Click the sky to select that area. Add to the. 4 Click the Quick Mask Mode button(q) in

PCIe: EYE DIAGRAM ANALYSIS IN HYPERLYNX

Applying effects including adjusting volume and fade in and out

***Please be aware that there are some issues of compatibility between all current versions of EndNote and macos Sierra (version 10.12).

Beginners How to Test DSO138mini

FOR WWW TEACUPSOFTWARE COM User Guide

Marist EarSketch Lesson 1 Music Remixing, Python, and EarSketch Student Directions

SigPlay User s Guide

Kindle Add-In for Microsoft Word User Guide

Defining and Labeling Circuits and Electrical Phasing in PLS-CADD

WAVES Cobalt Saphira. User Guide

invr User s Guide Rev 1.4 (Aug. 2004)

Digital Fashion Design

Introduction to capella 8

16B CSS LAYOUT WITH GRID

Guide to Writing Research Reports 101 (Includes APA Specifications)

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science

Using the TB Manual Template

Formatting Dissertations or Theses for UMass Amherst with MacWord 2008

Word Tutorial 2: Editing and Formatting a Document

Chapter 02: Creating a Research Paper with References and Sources

ENGR 1000, Introduction to Engineering Design

EndNote X7. Department of Information Technology Services: Strategic Support & Department of Library Services

Formatting a document in Word using APA style

What is Endnote? A bibliographical management software package designed to : Organize bibliographic references Create a bibliography

Thieme Dissector Manual

ConeXus User Guide. HHAeXchange s Communication Functionality

Word Module Each time the key is pressed, the paragraph formatting in the previous paragraph is carried forward to the next paragraph.

Information Literacy Program

Board Production In CircuitPro

Risk Management. Enhancing Referral Workflow. Karee Burns, RN, BSN. TJ McGreevy. Midas+ Solutions Consultant. Midas+ Product Management Specialist

EndNote X7 CWYW in Word 2008/2011 (Mac)

DigiView User's Guide TechTools

Page Numbering for a Thesis or Dissertation

EndNote for Mac. EndNote for PC. User Guide. UTS Library University of Technology Sydney UTS CRICOS PROVIDER CODE 00099F

TOMELLERI ENGINEERING MEASURING SYSTEMS. TUBO Version 7.2 Software Manual rev.0

ME EN 363 ELEMENTARY INSTRUMENTATION Lab: Basic Lab Instruments and Data Acquisition

Data Acquisition Using LabVIEW

The Measurement Tools and What They Do

Implementing a Factorial Survey in Qualtrics

If you finish the work for the day go to QUIA and review any objective you feel you need help with.

The ADAPTS function has been enhanced to support the new scan table mode as well as supporting the existing super stimulus mode.

SuperStar Basics. Brian Bruderer. Sequence Editors

Members QUICK REFERENCE GUIDE

+10db Compressor User s Manual. +10db Compressor. User s Manual

Formatting a Document in Word using MLA style

University of Liverpool Library. Introduction to Journal Bibliometrics and Research Impact. Contents

Transcription:

Turning a Text List into Inkscape Text Objects I quite enjoy board games and story telling games, and have had a crack at a few of them including the Nettlebed Caverns game which is available in a draft form on this webpage (www.techmonkeybusiness.com/nettlebed-caverns.html). One of the hall marks of my story telling games is that they have a HUGE number of cards...like 300 or so. This gives a lot more scope for variety in the stories and, well actually, it is a heap of fun making up what is going onto the cards. Writing out the list of cards in a word processor is fun. Writing them out again into a graphics package of some sort to lay them out as cards is a bit of a chore, particularly when you are dealing with 300 or more of them. So I felt there was a need for a simple script to take a list of text, and turn it into a heap of text elements in a vector based graphics program. Once the text was in the graphics program I could then use its tools to lay out the text nicely. I knew that Inkscape's (https://inkscape.org/) native file format (SVG) was just an XML so this was an obvious choice for the output. After a couple of tests, I observed that there was a block of unchanging XML at the start, and a convenient XML block for each text element. This meant that creating a quick and dirty python script that took each line in a text file and turned it into a separate text element in an SVG was relatively simple. I did not bother to use the script to position the text elements because I could use the Inkscape Object Distribution tools to spread it out once I had them in Inkscape. The python script does not use any libraries and so will run on the most basic python installation. As you will see, the vast majority of the script is putting the XML header into the file created. You can download the python script here: http://www.techmonkeybusiness.com/code/txt2inkscapexmlv1.py # TXT2InkscapeXMLv1.py # A simple script to look through a list of text and # turn each line into an xml entry for use in Inkscape. # in this script we will just dump all of the text # ontop of itself, irrespective of the actual layout # then use inkscape to spread it out. ofilenm = str(input("what is the filename you wish for output?")) outfile = open(ofilenm,"w") ListFlm = str(input("what is the name and location of the TXT file to work with?")) # The block that follows is the Inkscape standard header. <?xml version="1.0" encoding="utf 8" standalone="no"?>\n') <! Created with Inkscape (http://www.inkscape.org/) >\n')

\n') <svg\n') xmlns:dc="http://purl.org/dc/elements/1.1/"\n') xmlns:cc="http://creativecommons.org/ns#"\n') xmlns:rdf="http://www.w3.org/1999/02/22 rdfsyntax ns#"\n') xmlns:svg="http://www.w3.org/2000/svg"\n') xmlns="http://www.w3.org/2000/svg"\n') xmlns:sodipodi="http://sodipodi.sourceforge.net/dtd/sodipodi 0.dtd"\n') xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n') width="744.09448819"\n') height="1052.3622047"\n') id="svg2"\n') version="1.1"\n') inkscape:version="0.48.4 r9939"\n') sodipodi:docname="new document 1">\n') <defs\n') id="defs4" />\n') <sodipodi:namedview\n') id="base"\n') pagecolor="#ffffff"\n') bordercolor="#666666"\n') borderopacity="1.0"\n') inkscape:pageopacity="0.0"\n') inkscape:pageshadow="2"\n') inkscape:zoom="3.959798"\n') inkscape:cx="180.8475"\n') inkscape:cy="800.78961"\n') inkscape:document units="px"\n') inkscape:current layer="layer1"\n') showgrid="false"\n') inkscape:window width="1280"\n') inkscape:window height="742"\n') inkscape:window x=" 2"\n') inkscape:window y=" 3"\n') inkscape:window maximized="1" />\n') <metadata\n') id="metadata7">\n') <rdf:rdf>\n') <cc:work\n') rdf:about="">\n') <dc:format>image/svg+xml</dc:format>\n') <dc:type\n') rdf:resource="http://purl.org/dc/dcmitype/stillimage" />\n') <dc:title></dc:title>\n') </cc:work>\n')

</rdf:rdf>\n') </metadata>\n') <g\n') inkscape:label="layer 1"\n') inkscape:groupmode="layer"\n') id="layer1">\n') # The section that follows is to build the SVG text elements f = open(listflm,"r") for line in f: TXTLine = line.strip() <text\n') xml:space="preserve"\n') style="font size:10px;fontstyle:normal;font weight:normal;line height:125%;letterspacing:0px;word spacing:0px;fill:#000000;fillopacity:1;stroke:none;font family:sans"\n') x="93.910118"\n') y="250.56461"\n') id="text2989"\n') sodipodi:linespacing="125%"><tspan\n') sodipodi:role="line"\n') id="tspan2991"\n') x="93.910118"\n') y="250.56461">'+txtline+'</tspan></text>\n') #This is the text element from the list # The next section is the close off for the SVG xml. </g>\n') </svg>\n') outfile.close() How to use the script To use the script follow the steps outlined below: Save your list as a plain TXT file that only contains the list of items you wish to appear in the Inkscape illustration. Start up your python environment. I use Pyzo (www.pyzo.org/), but you could equally well use the terminal to run the script if you have an operating system with python already present. Load and run the script.

The script will ask you what you want to call the file it produces. Give some name with the.svg suffix. Your file will appear in the User directory for Linux Systems and possibly in the My Documents directory in Windows based systems. The script will then ask you to identify the list file that you are wanting processed. You will need to include the pathname, eg /home/user/documents/junk/list.txt. An instant later it will have the command prompt back up and you will wonder if anything happened. You should see your new.svg file in the User directory. Open the.svg in Inkscape. You will be faced with a black smear of text in the Inkscape document. Click on the pile of text to select the topmost one, and drag it somewhere down the page. Drag a box around all of the text elements to select them all.

Activate the Object >Align and Distribute panel (Shift+Ctrl+A) Distribute centres equidistantly vertically button to spread the text elements evenly between the top text element and the text element you dragged down the page.

In my case where I wish to create a grid of cards, there is a panel for distributing elements across a grid. You can find this under menu Object > Rows and Columns.

So now the list is a distributed series of text objects in Inkscape without having to retype them in. Yayyy! www.techmonkeybusiness.com