1e5c31af7Sopenharmony_ci// Copyright 2015-2024 The Khronos Group Inc. 2e5c31af7Sopenharmony_ci// 3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0 4e5c31af7Sopenharmony_ci 5e5c31af7Sopenharmony_ci[[miscellaneous]] 6e5c31af7Sopenharmony_ci= Image Authoring, Formats, and Style 7e5c31af7Sopenharmony_ci 8e5c31af7Sopenharmony_ciImages used in the Vulkan documents must be kept in the directory `images/` 9e5c31af7Sopenharmony_ciin SVG format. 10e5c31af7Sopenharmony_ci 11e5c31af7Sopenharmony_ciImages should be authored in the open-source 12e5c31af7Sopenharmony_cilink:https://inkscape.org/[`Inkscape`] tool, downloadable from its website 13e5c31af7Sopenharmony_cior packaged as an optional install for most Linux distributions. 14e5c31af7Sopenharmony_ciThis allows other people to easily edit your images in the future. 15e5c31af7Sopenharmony_ciAlso, while SVG is in principle a portable image format, some proprietary 16e5c31af7Sopenharmony_ciimage editors have been observed to produce images incompatible with the PDF 17e5c31af7Sopenharmony_ciimage pipeline used by the Specification. 18e5c31af7Sopenharmony_ci 19e5c31af7Sopenharmony_ciImages must be authored at their actual image size in the HTML and PDF 20e5c31af7Sopenharmony_cioutput documents, and must not be scaled with asciidoctor options. 21e5c31af7Sopenharmony_ciIn most cases, images are included as standalone figures and should occupy 22e5c31af7Sopenharmony_cithe full width of the document - do not leave unnecessary whitespace on 23e5c31af7Sopenharmony_cieither side of the image. 24e5c31af7Sopenharmony_ci 25e5c31af7Sopenharmony_ciThe PDF output has an available width of just over 660px (at the default 26e5c31af7Sopenharmony_ci96dpi), and a height somewhere around 1000px (which diagrams should really 27e5c31af7Sopenharmony_cigo nowhere near anyway). 28e5c31af7Sopenharmony_ciThe html output is wider (800 pixels) and with practically unlimited height. 29e5c31af7Sopenharmony_ciAs the PDF dimensions are more restrictive, images should not exceed these 30e5c31af7Sopenharmony_cilimits. 31e5c31af7Sopenharmony_ci 32e5c31af7Sopenharmony_ci[NOTE] 33e5c31af7Sopenharmony_ci.Note 34e5c31af7Sopenharmony_ci==== 35e5c31af7Sopenharmony_ciAccording to the documentation available, the PDF output *should* have 36e5c31af7Sopenharmony_cidimensions of roughly 184mm x 271mm - or equivalently 697px x 1026px (A4 37e5c31af7Sopenharmony_cisize [asciidoctor default] with a 0.5in margin [prawn-pdf default] on each 38e5c31af7Sopenharmony_ciside). 39e5c31af7Sopenharmony_ciHowever for reasons currently unknown, at least the available width before 40e5c31af7Sopenharmony_ciimages are scaled down lies is about 30-something pixels lower than that; 41e5c31af7Sopenharmony_cithe height where this happens has not been measured, but is likely to 42e5c31af7Sopenharmony_cisimilarly be lower than it should be for reasons currently unknown. 43e5c31af7Sopenharmony_ci==== 44e5c31af7Sopenharmony_ci 45e5c31af7Sopenharmony_ciDimensions of elements in the SVG file should be authored in pixels (`px`) 46e5c31af7Sopenharmony_cisuch that lines/strokes are not unnecessarily anti-aliased (e.g. usually 47e5c31af7Sopenharmony_cistick to integer pixel widths for lines). 48e5c31af7Sopenharmony_ciIn many cases it is useful to also set the background grid to px, but it not 49e5c31af7Sopenharmony_cinecessary; Inkscape has reliable conversions between px and mm using a 50e5c31af7Sopenharmony_cidefault dpi of 96 (which matches the PDF output), so the output dimension is 51e5c31af7Sopenharmony_cimostly irrelevant. 52e5c31af7Sopenharmony_ci 53e5c31af7Sopenharmony_ciText in images should usually appear at 12 point type so as to match that in 54e5c31af7Sopenharmony_cithe body of the specification, though 10 point text can be used sparingly 55e5c31af7Sopenharmony_ciwhere necessary (however this is often indicative of the diagram being too 56e5c31af7Sopenharmony_cicramped, so authors should consider scaling or reworking the diagram 57e5c31af7Sopenharmony_ciinstead). 58e5c31af7Sopenharmony_ciText should use the built-in generic sans serif font so as to ensure the 59e5c31af7Sopenharmony_cifont in the output document matches whatever sans serif font is used for 60e5c31af7Sopenharmony_cithat document. 61e5c31af7Sopenharmony_ciNote that the character set is currently <<character-sets-in-svg,restricted 62e5c31af7Sopenharmony_cito Windows-1252>>. 63e5c31af7Sopenharmony_ci 64e5c31af7Sopenharmony_ciThe font and color scheme used for existing images (black, red, and 50% 65e5c31af7Sopenharmony_cigray) should be used for changes and new images whenever reasonable to do 66e5c31af7Sopenharmony_ciso, to preserve a consistent look and feel. 67e5c31af7Sopenharmony_ciWhilst a white background is typically assumed, explicitly adding white as a 68e5c31af7Sopenharmony_cicolor should be avoided - instead leave elements transparent so the diagrams 69e5c31af7Sopenharmony_cican be used in other documents. 70e5c31af7Sopenharmony_ci 71e5c31af7Sopenharmony_ciMany other elements are consistent throughout the set of diagrams which 72e5c31af7Sopenharmony_cishould be maintained in new diagrams where possible. 73e5c31af7Sopenharmony_ciExamples include: 74e5c31af7Sopenharmony_ci 75e5c31af7Sopenharmony_ci * Lines are usually either fully solid, or use a consistent, and 76e5c31af7Sopenharmony_ci relatively spacious, dash style. 77e5c31af7Sopenharmony_ci * Lines are capped with a consistent arrow shape where relevant. 78e5c31af7Sopenharmony_ci * Small solid circles representing points are a consistently sized circle. 79e5c31af7Sopenharmony_ci 80e5c31af7Sopenharmony_ciWhenever reasonable, it is advised to copy an existing similar diagram and 81e5c31af7Sopenharmony_ciedit it rather than creating one from scratch in order to reuse elements and 82e5c31af7Sopenharmony_cimaintain consistency. 83e5c31af7Sopenharmony_ci 84e5c31af7Sopenharmony_ci 85e5c31af7Sopenharmony_ci[[character-sets-in-svg]] 86e5c31af7Sopenharmony_ci== Character Sets in SVG Files 87e5c31af7Sopenharmony_ci 88e5c31af7Sopenharmony_ciAt the moment, the PDF conversion path only supports the Windows-1252 89e5c31af7Sopenharmony_cicharacter set, as we are currently using the standard fonts built into every 90e5c31af7Sopenharmony_ciPDF viewer - such that we do not have to embed a different font. 91e5c31af7Sopenharmony_ciUnfortunately these only support Windows-1252, which is a highly limited 92e5c31af7Sopenharmony_cicharacter set. 93e5c31af7Sopenharmony_ci 94e5c31af7Sopenharmony_ciAs such, characters not in that set will not display properly when present 95e5c31af7Sopenharmony_ciin an SVG, and will generate a warning when building the PDF. 96e5c31af7Sopenharmony_ciLuckily, Inkscape has an "`Object to path`" function built in, which will 97e5c31af7Sopenharmony_ciconvert text to a raw path, allowing these characters to be supported. 98e5c31af7Sopenharmony_ci 99e5c31af7Sopenharmony_ciPlease ensure that you build the PDF before submitting any new images, 100e5c31af7Sopenharmony_ciparticularly with non-standard characters, in order to catch such errors. 101e5c31af7Sopenharmony_ci 102e5c31af7Sopenharmony_ci 103e5c31af7Sopenharmony_ciifdef::editing-notes[] 104e5c31af7Sopenharmony_ci[NOTE] 105e5c31af7Sopenharmony_ci.editing-note 106e5c31af7Sopenharmony_ci==== 107e5c31af7Sopenharmony_ci*Other Stuff Which May Be Described In This Chapter Eventually* 108e5c31af7Sopenharmony_ci 109e5c31af7Sopenharmony_ci * Something about Image formats 110e5c31af7Sopenharmony_ci * Something about validation scripts 111e5c31af7Sopenharmony_ci * Glossary lists 112e5c31af7Sopenharmony_ci * New param/enum macros 113e5c31af7Sopenharmony_ci==== 114e5c31af7Sopenharmony_ciendif::editing-notes[] 115e5c31af7Sopenharmony_ci 116