X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=QXdL59E8QLUx3+DX3cP/q3UAS6pgOfL5OGOmkliZ038=; b=Yxo3NpA42hju2rBVI3ZnCUK/6s7zQ49UUOEzfeS+VuDUKc6Bv2+VLXYHYdXQbOgvzD WYlAH3JOURNK305fTUEY8rQeAu14QtCSMV8EchwnbuTHkhlIc1jjKge1BxlET6sqAUaf i68a8w4grEvUmEhX5yDjh4uTaF52FDMgc9azE2SM/ubHo9KPLVIihM71Df1xxKLG6gbT Kf4PtfMawh5l8keGDDhJznJR8avVABt2MSS+rvnFVa4h9bYD2MWRCHgEM5NsWy0YAmPS i0J4C5u8lXYnt9JpAcEQlcGPvlBSJeA3d4xryKK0mCfZleXjTlo4qYqXvDLem7pD8nCQ zsaA== MIME-Version: 1.0 X-Received: by 10.221.8.66 with SMTP id or2mr108615vcb.65.1410749152011; Sun, 14 Sep 2014 19:45:52 -0700 (PDT) In-Reply-To: <1410720667.1331.1.camel@ssalewski.de> References: <1410720667 DOT 1331 DOT 1 DOT camel AT ssalewski DOT de> Date: Mon, 15 Sep 2014 12:15:51 +0930 Message-ID: Subject: Re: [geda-user] A complete set of CJK glyphs rendered as PCB symbols From: Erich Heinzle To: geda-user Content-Type: multipart/alternative; boundary=089e0117724712aaf0050311a201 Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk --089e0117724712aaf0050311a201 Content-Type: text/plain; charset=UTF-8 The fonts for X windows are commonly available in bdf format. http://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format The bdf font file is a series of consecutive symbol definitions of the form: STARTCHAR U+004E ENCODING 78 SWIDTH 500 0 DWIDTH 8 0 BBX 8 16 0 -2 BITMAP 00 00 00 00 42 62 62 52 52 4A 4A 46 46 42 00 00 ENDCHAR My utility 1) acquires a valid BDF symbol definition via stdin 2) extracts the glyph label, glyph height, glyph width, display width, and the bitmap nibbles 2.1) optionally exports an xbm bitmap 2.2) optionally exports a "Dot matrix" PCB symbol rendition of the glyph using SymbolLine strokes to depict dots 3) stores the nibbles for each line in the glyph as a single integer 4) creates arrays in which each pixel is depicted as an integer 5) steps through the single integer representation of the rows and scores each pixel, putting the score into the integer per pixel row array 6) exports consecutive rows of pixels as a SymbolLine strokes 7) steps through each column of scored pixels and does further scoring of each pixel, putting the score into the integer per pixel column array 8) exports consecutive columns of pixels as a SymbolLine strokes 8.1) optionally exports a symbol without diagonal row detection and conversion to strokes 9) creates left and right skewed arrays of the final pixel scores after column and row export 10) steps through the single integer representation of the right skewed array columns and detects diagonals, exports SymbolLine strokes 11) steps through the single integer representation of the left skewed array columns and detects diagonals, exports SymbolLine strokes 12) identifies any left over/orphan pixels and exports a SymbolLine stroke to depict a "dot" 13) exports a complete symbol with vertical, horizontal, and diagonal strokes 14) looks for another BDF symbol via stdin This produces output containing a series of geda PCB symbol definitions for each glyph, and is what is in the gz file I mentioned. Until we have a mechanism for seamlessly adding unicode symbols or rendering ttf fonts, users needing glyphs can search the gzipped archive and cut and paste their needed symbol, and relabel it to assign it to an unused ascii character. Anything that increases the potential user base by > 1 billion has got to be a good thing. Cheers Erich. On Mon, Sep 15, 2014 at 4:21 AM, Stefan Salewski wrote: > On Mon, 2014-09-15 at 00:59 +0930, Erich Heinzle wrote: > > I have batch processed the gnu unifont bdf > > Is there a detailed description available about the conversion process? > > I can remember that I was not really happy with PCB's way including > fonts as lines in each pcb file some years ago, so I did some thinking > about how to do on the fly conversion of arbitrary fonts -- inkscape's > ability to convert bitmaps to vector graphics was one possible way that > time, but I have never investigated it. (My general idea was to use > ordinary fonts for screen display, and convert to lines only for gerber > export.) > > I have never seen a pcb board with a single Chinese character, and I can > not imagine why an Asian person should have the wish to have such glyphs > on a pcb board. But the conversion process is interesting of course... > > > --089e0117724712aaf0050311a201 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

The fonts for X windows are commonly av= ailable in bdf format.

http://en.wikipedia.org/wiki/Glyph_Bitmap_Dist= ribution_Format

The bdf font file is a series of consecuti= ve symbol definitions of the form:

STARTCHAR U+004E
ENCODING 78SWIDTH 500 0
DWIDTH 8 0
BBX 8 16 0 -2
BITMAP
00
00
00<= br>00
42
62
62
52
52
4A
4A
46
46
42
00
= 00
ENDCHAR


My utility
1) acquires a valid BDF symbol= definition via stdin
2) extracts the glyph label, glyph height, g= lyph width, display width, and the bitmap nibbles
2.1) optiona= lly exports an xbm bitmap
2.2) optionally exports a "Dot= matrix" PCB symbol rendition of the glyph using SymbolLine strokes to= depict dots
3) stores the nibbles for each line in the glyph= as a single integer
4) creates arrays in which each pixel is= depicted as an integer
5) steps through the single integer r= epresentation of the rows and scores each pixel, putting the score into the= integer per pixel row array
6) exports consecutive rows of p= ixels as a SymbolLine strokes
7) steps through each column of= scored pixels and does further scoring of each pixel, putting the score in= to the integer per pixel column array
8) exports consecutive columns of = pixels as a SymbolLine strokes
8.1) optionally exports a symbol w= ithout diagonal row detection and conversion to strokes
9) cr= eates left and right skewed arrays of the final pixel scores after column a= nd row export
10) steps through the single integer representa= tion of the right skewed array columns and detects diagonals, exports Symbo= lLine strokes
11) steps through the single integer representation of the= left skewed array columns and detects diagonals, exports SymbolLine stroke= s
12) identifies any left over/orphan pixels and exports a Symbol= Line stroke to depict a "dot"
13) exports a complet= e symbol with vertical, horizontal, and diagonal strokes
14) = looks for another BDF symbol via stdin

This produces outp= ut containing a series of geda PCB symbol definitions for each glyph, and i= s what is in the gz file I mentioned.

Until we= have a mechanism for seamlessly adding unicode symbols or rendering ttf fo= nts, users needing glyphs can search the gzipped archive and cut and paste = their needed symbol, and relabel it to assign it to an unused ascii charact= er.

Anything that increases the potential user base by > 1 billion h= as got to be a good thing.

Cheers
Erich.


On Mon, Sep 15, 2014 at 4:21 AM, Stefan Salewski <mail AT ssalewski.= de> wrote:
On Mon, 2014-09-15 at 00:59 +0930, Erich Heinzle wrote:=
> I have batch processed the gnu unifont bdf

Is there a detailed description available about the conversion proce= ss?

I can remember that I was not really happy with PCB's way including
fonts as lines in each pcb file some years ago, so I did some thinking
about how to do on the fly conversion of arbitrary fonts -- inkscape's<= br> ability to convert bitmaps to vector graphics was one possible way that
time, but I have never investigated it. (My general idea was to use
ordinary fonts for screen display, and convert to lines only for gerber
export.)

I have never seen a pcb board with a single Chinese character, and I can not imagine why an Asian person should have the wish to have such glyphs on a pcb board. But the conversion process is interesting of course...



--089e0117724712aaf0050311a201--