X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=3F7tMyAd8XCCGgT9PMrZswPaWB3AJpqqCKa+x4DmVK0=; b=DlT2sME6Hn7Vrv1YUhfxYjIVPbRAwPjO9EgSVXubFVl3g6dCTEhZwXuxLSxrF//ZDE zsBpukeGFIIoNhKWNBYaMOW2EA7BmUNYxctWfnZeQkYa7tu0jlnC2lChlu3OOAbp5zXb 4zlDKEX8eHOAjmvkDwrm9lZw5TPYwK2enON2ep8CLlQP2dWAze3r1aDb+771Q6czJOL6 Lx3KY/TDUAjGbAHjlC+1vDfUzzqjrkwdt/rLmh8uw4wMCHWzn6VraH2CSxSFMtqV1FcO eVCEIih+hayuXuk1pH8hnNPU92W2Ndz+CJjngijK+BkT1GI2mS/ukp2T38M2T26M8/AH u2yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=3F7tMyAd8XCCGgT9PMrZswPaWB3AJpqqCKa+x4DmVK0=; b=b4cTzm5WLlkCIm3yG1+doY+qBfkIKl8k9ET0fKA9evxIw8WkcMB5Ci0+U/JLC1G2vk BXnjqDfwu5bzbiSNzWHcKltSNt7bDtPShEXYTK+1ONy67x5TVx8vlaAtVsUi6964rZ+9 cY9+OCUHOwo7ZYEhxOkUQ4Cm32uz3pZgNlxv/rxKEJ3R98yGNPP3VaDiMhHOZeFHHlPo 0oQ1AYiKWNBMEfluATy5xIPYx1P4uXrJEUEMgMDwmcLoeIm/ZVIKyuFf+scACNWgNvhF h2PCb5djOyjXs2I850ehQ0US3WRzHPC3zrk2jEN5oNiIOnSsoMZbO7OY7w2TJHzLdzEt y4Xg== X-Gm-Message-State: AKaTC02zy4m8zQKf9iVORhE6wCru8+qRzrKYfnD7oeJqbXYDxksCS7hChvN2Rf81HLKa3/bpm692T7YR4YalhA== X-Received: by 10.157.41.155 with SMTP id n27mr52660298otb.158.1481635652515; Tue, 13 Dec 2016 05:27:32 -0800 (PST) MIME-Version: 1.0 From: "Erich Heinzle (a1039181 AT gmail DOT com) [via geda-user AT delorie DOT com]" Date: Tue, 13 Dec 2016 23:57:32 +1030 Message-ID: Subject: [geda-user] A workflow for gEDA PCB font symbol/glyph creation To: geda-user Content-Type: text/plain; charset=UTF-8 Reply-To: geda-user AT delorie DOT com I have had some success in converting graphical depictions of lettering, i.e. from a simple picture, into gEDA PCB compatible font glyphs with the following technique. The pcb-rnd fork is particularly well suited to this task for reasons which will become apparent A .ppm format image with the glyphs/characters to be converted into a stroked font compatible with gEDA PCB needs to be found, and its dimensions in pixels, X, Y, noted PCB is then loaded, with the .ppm image selected for background display ./pcb-rnd --bg-image my_desired_symbols.ppm & the board width and height must then be made a multiple of X and Y, to provide the correct aspect ratio for the exported symbols. For simple sans serif fonts, the centreline of the glyph can be traced, to create a stroked, or centreline defined version of the font. Once a set of silk lines has been generated for a glyph, they can be selected, and copied into the paste buffer, being careful to have the cursor suitably positioned at the lower left hand corner of the glyph consistently for all glyphs processed, to ensure the vertical alignment of glyphs is properly preserved in the resulting font. The paste buffer can then be converted to an element via the menus. Having done this, the buffer can then be saved with the "Save buffer elements to file" menu item. The same process is repeated for any additional glyphs, choosing a suitable filename in which to save the element each time. Having created a set of elements (footprints) with silk lines depicting the needed glyphs, a new layout can be created in which one copy of each element is placed, using the "load element to paste buffer" menu item, and then placing the element. It is at this point that pcb-rnd can be used to advantage (available at http://repo.hu/projects/pcb-rnd/ ). Having placed all of the desired elements on the layout (each element being a footprint depicting a unique glyph), select all of them, and copy them to the buffer. pcb-rnd allows the buffer elements to be saved to file, as a kicad legacy library of modules. The library of modules (a .mod file) can then be converted into font glyph definitions with https://github.com/erichVK5/KicadModuleToGEDA by using the -g flag when invoked. Furthermore, KicadModuleToGEDA allows a magnification ratio to be specified in the module header, so that the final glyph sizes can be fine tuned to be around 5000 centimils high, with a descent of around 1000 (i.e the dangly bit of a lower case p or q), and a stroke width of between 600 and 800 centimils, given the silk screen process limitations of typical pcb fabs. This ability to fine tune the magnification during final conversion eliminates the need for careful scaling in the image preparation and subsequent drawing phase of the process. The result will be a set of files, one per glyph, containing glyph definitions which can be copied and pasted into a font file i.e. like /src/default_font, replacing existing symbol definitions. This workflow may save someone a lot of tedious reinvention of the wheel. There is clearly scope to use a work process like this in pcb +/- further refinements, to produce engraving fonts relatively quickly and easily, since tools such as fontforge are designed to work on outline fonts (i.e. ttf, PS), rather than centreline defined a.k.a. stroked fonts. Cheers, Erich.