content.texi 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. @c Copyright @copyright{} 2022 Yevhen Babiichuk (DustDFG).
  2. @node Top
  3. @top Human Friendly Inkscape Designer
  4. @node Preface
  5. @chapter Preface
  6. Inkscape is a free SVG editor that gives you an opportunity to create excellent
  7. artworks without big difficulties. This very comfortable tool doesn't try to
  8. limit you, so you are free to draw whatever you want but this extremely powerful
  9. tool needs your attention, without which you won't create clear and human
  10. readable artwork.
  11. The book was written to teach you how to avoid disadventages of Inkscape which
  12. prevent you from creating graceful, readable and human friendly artworks. It
  13. will teach you how to become an excellent "Human Friendly Inkscape Designer".
  14. @node Metadata
  15. @chapter Metadata
  16. Metadata is data that describes other data. You can see it in a simple example.
  17. Artwork that you create is data, it doesn't describe something else. On the
  18. contrary, information about size describes property of artwork, so it is
  19. metadata.
  20. @node Metadata carrier
  21. @section Metadata carrier
  22. SVG supports all XML facilities, including namespaces. Their strength lies in
  23. the fact that they allow you to include some data to the document without any
  24. conflicts. Namespaces provide you an opprtunity to define uniqely named scopes
  25. for elements and attributes, which won't conflict with elements and attributes
  26. from other scopes. They are the main way to provide metadata inside the
  27. document.
  28. The syntax of namespaces is very simple. Declaration of the namespaces uses
  29. @code{xmlns:@var{namespace_name}="@var{namespace_uri}"} syntax. After declaring
  30. namespace it becomes available to use. To point namespace for element or
  31. attribute you need to use
  32. @code{@var{namespace_name}:@var{element_name}} or
  33. @code{@var{namespace_name}:@var{attribute_name}} syntax, respectively.
  34. XML standard says that you have an opportunity to declare @var{default}
  35. namespace with @code{xmlns="@var{namespace_uri}"} syntax. It means that all the
  36. elements and attributes declared without qualification namespace belongs to the
  37. @var{default} namespace. You could see its decaration for SVG before in your
  38. artwoks as @code{xmlns="http://www.w3.org/2000/svg"}.
  39. @node RDF metadata
  40. @section RDF metadata
  41. SVG standard defines @code{metadata} element intended to store all general
  42. metadata about the document. The standard doesn't define any elements or
  43. attributes tha can be nested in the @code{metadata} element. It suppose that
  44. all nested elements will belong to other namespaces.
  45. Inkscape uses for that purpose three genral namespaces:
  46. @code{xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"},
  47. @code{xmlns:cc="http://creativecommons.org/ns#"},
  48. @code{xmlns:dc="http://purl.org/dc/elements/1.1/"}
  49. @node Inkscape metadata
  50. @section Inkscape metadata
  51. Inkscape uses some abstractions to make some things easier (mostly for itself).
  52. It represents these abstractions as metadata inside your artwork. Usually it
  53. is useful while you are in creation process but it is almost useless when work
  54. is finished. Inkscape stores @emph{almost} all its own metadata in two
  55. namespaces @code{inkscape} and @code{sodipodi} that declared in the document as
  56. @code{xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"} and
  57. @code{xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"}
  58. @footnote{Inkscape is a derivative of an old vector image editor with name
  59. Sodipodi. Inkscape uses sodipodi metadata namespace for backward
  60. compatibility.} respectively. They declares some attributes, which will be
  61. described later and only one element @code{sodipodi:namedview} (place where you
  62. will find about half of these attributes).
  63. @node Inkscape general document metadata
  64. @subsection Inkscape general document metadata
  65. Inkscape uses some attributes to store general information about the document.
  66. @multitable @columnfractions .15 .35 .5
  67. @headitem Element @tab Attribute @tab Description
  68. @item @code{svg}
  69. @tab @code{sodipodi:version}
  70. @tab Stores information about version of Sodipodi in which document was
  71. created.
  72. @item @code{svg}
  73. @tab @code{inkscape:version}
  74. @tab Stores information about version of Inkscape in which document was
  75. created.
  76. @item @code{svg}
  77. @tab @code{sodipodi:docname}
  78. @tab Stores name of document.
  79. @item @code{svg}
  80. @tab @code{sodipodi:docbase}
  81. @tab Stores path to the document.
  82. @end multitable
  83. @quotation Note
  84. @code{sodipodi:version} attribute is obsolescent.
  85. @end quotation
  86. @quotation Warning
  87. @code{sodipodi:docbase} attribute can contain your sensitive information.
  88. @end quotation
  89. @quotation Tip
  90. These attributes, except maybe @code{inkscape:version}, should not appear in
  91. release version of work, they are redudant and useless.
  92. @end quotation
  93. @node Inkscape export metadata
  94. @subsection Inkscape export metadata
  95. When you export your artwork in a fromat different from SVG, Inkscape adds to
  96. the document three metadata attributes that represent options, used during last
  97. export.
  98. @multitable @columnfractions .15 .35 .5
  99. @headitem Element @tab Attribute @tab Description
  100. @item @code{svg}
  101. @tab @code{inkscape:export-xdpi}
  102. @tab Stores information about @abbr{DPI, Dots Per Inch} by x axis, used during
  103. export.
  104. @item @code{svg}
  105. @tab @code{inkscape:export-ydpi}
  106. @tab Stores information about @abbr{DPI, Dots Per Inch} by y axis, used during
  107. export.
  108. @item @code{svg}
  109. @tab @code{inkscape:export-filename}
  110. @tab Stores path to the file or its name, used during export.
  111. @end multitable
  112. @quotation Note
  113. Inkscape rewrite these attributes with new values each time you export the
  114. work.
  115. @end quotation
  116. @quotation Warning
  117. @code{inkscape:export-filename} attribute can contain your sensitive
  118. information.
  119. @end quotation
  120. @quotation Tip
  121. These attributes should not appear in release version of work, they are
  122. redudant and useless.
  123. @end quotation
  124. @node Inkscape layers metadata
  125. @subsection Inkscape layers metadata
  126. Information about layers is the most useful metadata stored by Inkscape.
  127. @multitable @columnfractions .15 .35 .5
  128. @headitem Element @tab Attribute @tab Description
  129. @item @code{g}
  130. @tab @code{inkscape:groupmode="layer"}
  131. @tab Mark @code{g} element as @var{Inkscape layer}.
  132. @item @code{g}
  133. @tab @code{inkscape:label}
  134. @tab Contains name of @var{Inkscape layer} displayed by Inkscape in
  135. @samp{Layers} tab.
  136. @item @code{g}
  137. @tab @code{sodipodi:insensitive="true"}
  138. @tab Mark @var{Inkscape layer} as immutable.
  139. @item @code{sodipodi:namedview}
  140. @tab @code{inkscape:current-layer}
  141. @tab Contains value of @code{id} attribute of @code{g} element that represents
  142. selected @var{Inkscape layer}.
  143. @end multitable
  144. @quotation Tip
  145. These metadata attributes are very useful so you should keep them except the
  146. last two because they don't have much sense for release version of work.
  147. @end quotation
  148. @node Suboptimal solutions
  149. @chapter Suboptimal solutions
  150. Inkscape is a smart tool but it doesn't (can't) check most semantic features of
  151. the artwork elements so it often produces suboptimal solutions.
  152. @node Circles saved as ellipses
  153. @section Circles saved as ellipses
  154. When you use Inkscapes tool @samp{Ellipse}, you can create ellipses that looks
  155. like circles. The problem appears because it is almost impossible create by
  156. eye ideal circle with tool that uses floating point numbers. You will think
  157. that you created a circle, it will have almost equal @code{rx} and @code{ry}
  158. attributes so Inkscape will think that it is an ellipse. You will see object
  159. that looks like circe but Inkscape will save it as ellipse. It can be really
  160. misleading so you should try to avoid these situations. Fortunately it is
  161. simple to correct code. You just need to rename elemnet and replace @code{rx}
  162. and @code{ry} attributes with @code{r} one.
  163. @quotation Tip
  164. To fix the problem directly from Inkscape you need to follow the one of the
  165. instructions described below. (They don't always work)
  166. Instruction one:
  167. @enumerate
  168. @item
  169. Select @samp{Ellipse} tool.
  170. @item
  171. Select an ellipse that you need to convert to a circle.
  172. @item
  173. Make values @samp{Rx} and @samp{Ry} from input fields that appeared in
  174. @var{Tool controls bar} when you selected an ellipse equal.
  175. @end enumerate
  176. @end quotation
  177. @node Formatting
  178. @chapter Formatting
  179. Formatting is a very important part of each document. Bad or inconsistent
  180. formatting will make your document difficult to read and understand.
  181. @node Identation
  182. @section Identation
  183. Identation of code is a method of emphasizing semantic properties of the code.
  184. SVG code, which is XML, is a tree of elements nested one inside the other. XML
  185. formatting best practices is also applicable to SVG so you should follow them.
  186. @node Identation characters
  187. @subsection Identation characters
  188. It is a holywar topic which character to use for identation purposes. Each
  189. designer has their own preferences. Some of them prefer spaces, others prefer
  190. tabs just like me. I advise you to use tabs beacuse it is a dynamically "wide"
  191. character. Each designer will be able to choose their own width for display so
  192. everyone will be happy. As a bonus of using tabs, you will get a reduction of
  193. file size ;)