www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2014/09/14/22:46:45

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: <CAHUm0tNe1zgfb02ftk-o0dvaDUUuO0ed2VHgEcbgaqdZkjim0A AT mail DOT gmail DOT com>
<1410720667 DOT 1331 DOT 1 DOT camel AT ssalewski DOT de>
Date: Mon, 15 Sep 2014 12:15:51 +0930
Message-ID: <CAHUm0tNw_D0uUain8Px_CgyiDv=fdj1=C5VrdrYQog+8cNKJaA@mail.gmail.com>
Subject: Re: [geda-user] A complete set of CJK glyphs rendered as PCB symbols
From: Erich Heinzle <a1039181 AT gmail DOT com>
To: geda-user <geda-user AT delorie DOT com>
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

--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 <mail AT ssalewski DOT 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 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

<div dir=3D"ltr"><div><div><div><br>The fonts for X windows are commonly av=
ailable in bdf format.<br><br><a href=3D"http://en.wikipedia.org/wiki/Glyph=
_Bitmap_Distribution_Format">http://en.wikipedia.org/wiki/Glyph_Bitmap_Dist=
ribution_Format</a><br><br></div>The bdf font file is a series of consecuti=
ve symbol definitions of the form:<br><br>STARTCHAR U+004E<br>ENCODING 78<b=
r>SWIDTH 500 0<br>DWIDTH 8 0<br>BBX 8 16 0 -2<br>BITMAP <br>00<br>00<br>00<=
br>00<br>42<br>62<br>62<br>52<br>52<br>4A<br>4A<br>46<br>46<br>42<br>00<br>=
00<br>ENDCHAR<br><br><br></div>My utility<br>1) acquires a valid BDF symbol=
 definition via stdin<br></div>2) extracts the glyph label, glyph height, g=
lyph width, display width, and the bitmap nibbles<br><div><div>2.1) optiona=
lly exports an xbm bitmap<br></div><div>2.2) optionally exports a &quot;Dot=
 matrix&quot; PCB symbol rendition of the glyph using SymbolLine strokes to=
 depict dots<br></div><div>3) stores the nibbles for each line in the glyph=
 as a single integer<br></div><div>4) creates arrays in which each pixel is=
 depicted as an integer<br></div><div>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<br></div><div>6) exports consecutive rows of p=
ixels as a SymbolLine strokes<br></div><div>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<br>8) exports consecutive columns of =
pixels as a SymbolLine strokes</div><div>8.1) optionally exports a symbol w=
ithout diagonal row detection and conversion to strokes<br></div><div>9) cr=
eates left and right skewed arrays of the final pixel scores after column a=
nd row export<br></div><div>10) steps through the single integer representa=
tion of the right skewed array columns and detects diagonals, exports Symbo=
lLine strokes<br>11) steps through the single integer representation of the=
 left skewed array columns and detects diagonals, exports SymbolLine stroke=
s</div><div>12) identifies any left over/orphan pixels and exports a Symbol=
Line stroke to depict a &quot;dot&quot;<br></div><div>13) exports a complet=
e symbol with vertical, horizontal, and diagonal strokes<br></div><div>14) =
looks for another BDF symbol via stdin<br><br></div><div>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.<br></div><div><br></div><div>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.<br></div></div><div class=3D"gmail_extra"><br></div><div class=3D"gmail=
_extra">Anything that increases the potential user base by &gt; 1 billion h=
as got to be a good thing.<br><br></div><div class=3D"gmail_extra">Cheers<b=
r><br>Erich.<br></div><div class=3D"gmail_extra"><br><br><div class=3D"gmai=
l_quote">On Mon, Sep 15, 2014 at 4:21 AM, Stefan Salewski <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:mail AT ssalewski DOT de" target=3D"_blank">mail AT ssalewski.=
de</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"marg=
in:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1e=
x"><span class=3D"">On Mon, 2014-09-15 at 00:59 +0930, Erich Heinzle wrote:=
<br>
&gt; I have batch processed the gnu unifont bdf<br>
<br>
</span>Is there a detailed description available about the conversion proce=
ss?<br>
<br>
I can remember that I was not really happy with PCB&#39;s way including<br>
fonts as lines in each pcb file some years ago, so I did some thinking<br>
about how to do on the fly conversion of arbitrary fonts -- inkscape&#39;s<=
br>
ability to convert bitmaps to vector graphics was one possible way that<br>
time, but I have never investigated it. (My general idea was to use<br>
ordinary fonts for screen display, and convert to lines only for gerber<br>
export.)<br>
<br>
I have never seen a pcb board with a single Chinese character, and I can<br=
>
not imagine why an Asian person should have the wish to have such glyphs<br=
>
on a pcb board. But the conversion process is interesting of course...<br>
<br>
<br>
</blockquote></div><br></div></div>

--089e0117724712aaf0050311a201--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019