[GOODIE] X11Fonts (was RE: Adding Accufonts to the update stream)
Daniel Vainsencher
danielv at netvision.net.il
Mon Mar 10 14:04:37 UTC 2003
Do consider that SM has categories for Alpha software. I think it's
important to make packages visible, and not conflate this issue with
package maturity.
Consider the case where someone starts writing a similar framework,
because they don't see yours on SM, where they could instead help you
mature TW faster.
Daniel
Boris Gaertner <Boris.Gaertner at gmx.net> wrote:
> This is a multi-part message in MIME format.
>
> --Boundary_(ID_77N+zAbuddL4HYWk2eu0bQ)
> Content-type: text/plain; charset=iso-8859-1
> Content-transfer-encoding: 7BIT
>
> As promised in my mail from Mar 07, I looked into
> the BDF stuff to find out why the X11-fonts are crippled
> at the highest codepoints. The attached change set is my
> attempt to better the situtation. On a windows-based pc
> I got acceptable results. It would be nice to have a test
> report from a test on a Unix or Linus machine.
>
>
> I made my font editor available. You can download it from
> http://www.bgaertner.gmxhome.de/
>
> It is still not on SqueakMap and I do not intend to add it
> there soon. The FontEditor is usable, but the framework
> it is built upon (ThirdWay) is still quite unfinished in my
> opinion. Well, one day it will be finished and given to
> SqueakMap, too.
>
> Note that you need two download two files to
> install the font editor:
> TW.zip for the framework
> FontEditor.ZIP for the font editor itself.
>
> Load first tw.cs and than fontEditor.cs.
>
> Enjoy,
> Boris
>
>
> --Boundary_(ID_77N+zAbuddL4HYWk2eu0bQ)
> Content-type: application/octet-stream; name=BDF.1.cs
> Content-transfer-encoding: quoted-printable
> Content-disposition: attachment; filename=BDF.1.cs
>
> 'From Squeak3.4 of 1 March 2003 [latest update: #5170] on 9 March 2003 =
> at 8:36:05 pm'!=0D"Change Set: BDF=0DDate: 9 March 2003=0DAuthor: =
> Boris Gaertner=0D=0DWe experienced problems to completely load X11fonts =
> - the last glyphs where always missing. "!=0D=0D=0D!BDFFontReader =
> methodsFor: 'as yet unclassified' stamp: 'BG 3/9/2003 20:03'!=0Dread=0D =
> | xTable strikeWidth glyphs ascent descent minAscii maxAscii maxWidth =
> chars charsNum height form encoding bbx array width blt lastAscii =
> pointSize ret dwidth cell cellBlt |=0D form _ encoding _ bbx _ nil.=0D =
> self initialize.=0D self readAttributes. =0D height _ Integer =
> readFromString: ((properties at: #FONTBOUNDINGBOX) at: 2).=0D ascent _ =
> Integer readFromString: (properties at: 'FONT_ASCENT' asSymbol) =
> first.=0D descent _ Integer readFromString: (properties at: =
> 'FONT_DESCENT' asSymbol) first.=0D pointSize _ (Integer readFromString: =
> (properties at: 'POINT_SIZE' asSymbol) first) // 10.=0D =0D maxWidth _ =
> 0.=0D minAscii _ 9999.=0D strikeWidth _ 0.=0D maxAscii _ 0.=0D=0D =
> charsNum _ Integer readFromString: (properties at: #CHARS) first.=0D =
> chars _ Set new: charsNum.=0D=0D 1 to: charsNum do: [:i |=0D array _ =
> self readOneCharacter.=0D form _ array at: 1.=0D encoding _ array at: =
> 2.=0D bbx _ array at: 3.=0D dwidth _ array at: 4.=0D=0D "form isNil =
> ifFalse: [form morphEdit]."=0D "self halt."=0D =0D form ifNotNil: =
> [=0D dwidth _ dwidth" - 1".=0D width _ dwidth max: (bbx at: 1).=0D =
> maxWidth _ maxWidth max: width.=0D minAscii _ minAscii min: =
> encoding.=0D maxAscii _ maxAscii max: encoding.=0D strikeWidth _ =
> strikeWidth + width.=0D chars add: array.=0D ].=0D ].=0D=0D chars _ =
> chars asSortedCollection: [:x :y | (x at: 2) <=3D (y at: 2)].=0D =
> charsNum _ chars size. "undefined encodings make this different"=0D=0D =
> xTable _ (Array new: 258) atAllPut: 0.=0D=0D glyphs _ Form extent: =
> strikeWidth at height.=0D blt _ BitBlt toForm: glyphs.=0D lastAscii _ 0.=0D =
> =0D 1 to: charsNum do: [:i | =0D | unspliceArray |=0D unspliceArray _ =
> chars at: i.=0D form _ unspliceArray at: 1.=0D encoding _ =
> unspliceArray at: 2.=0D bbx _ unspliceArray at: 3.=0D dwidth _ =
> (unspliceArray at: 4).=0D width _ dwidth max: (bbx at: 1).=0D =
> lastAscii+1 to: encoding-1 do: [:a | xTable at: a+2 put: (xTable at: =
> a+1)].=0D=0D "I should be able to do all of this in one blit, but I'm =
> too confused. Create=0D a Form of the proper size for this glyph, =
> render the BDF bitmap into it, then =0D stamp it into the StrikeFont =
> glyphs form."=0D cell _ Form extent: width at height.=0D cellBlt _ BitBlt =
> toForm: cell.=0D=0D cellBlt copy: ((bbx at: 3)@((ascent - (bbx at: 2) - =
> (bbx at: 4)))=0D extent: (bbx at: 1)@(bbx at: 2))=0D from: 0 at 0 in: =
> form.=0D blt copyForm: cell to: (xTable at: encoding+1)@0 rule: Form =
> over. =0D=0D "blt copy: (( ((xTable at: encoding+1)+(bbx at: =
> 3))@(ascent - (bbx at: 2) - (bbx at: 4)))=0D extent: (bbx at: 1)@(bbx =
> at: 2))=0D from: 0 at 0 in: form."=0D xTable at: encoding+2 put: (xTable =
> at: encoding+1)+(width).=0D lastAscii _ encoding.=0D ].=0D=0D ret _ =
> Array new: 8.=0D ret at: 1 put: xTable.=0D ret at: 2 put: glyphs.=0D ret =
> at: 3 put: minAscii.=0D ret at: 4 put: maxAscii.=0D ret at: 5 put: =
> maxWidth.=0D ret at: 6 put: ascent.=0D ret at: 7 put: descent.=0D ret =
> at: 8 put: pointSize.=0D ^ret.=0D" ^{xTable. glyphs. minAscii. maxAscii. =
> maxWidth. ascent. descent. pointSize}"! !=0D=0D!BDFFontReader =
> methodsFor: 'as yet unclassified' stamp: 'BG 3/9/2003 =
> 13:08'!=0DreadAttributes=0D | str a pos |=0D "I don't handle =
> double-quotes correctly, but it works"=0D self reset.=0D [self atEnd] =
> whileFalse: [=0D pos :=3D self position.=0D str _ self getLine.=0D =
> (str beginsWith: 'STARTCHAR') ifTrue: [self position: pos. ^self].=0D a =
> _ str substrings.=0D properties at: a first asSymbol put: a =
> allButFirst.=0D ].=0D self error: 'file seems corrupted'.! =
> !=0D=0D=0D!StrikeFont methodsFor: 'file in/out' stamp: 'BG 3/9/2003 =
> 20:02'!=0DreadBDFFromFile: fileName name: aString=0D "This builds a =
> StrikeFont instance by reading the X11 Binary =0D Distribution Format =
> font source file. See the BDFFontReader class=0D comment."=0D =
> "StrikeFont new readBDFFromFile: 'helvR12' name: 'Helvetica12'."=0D=0D | =
> fontReader a |=0D fontReader _ BDFFontReader oldFileNamed: fileName.=0D =
> a _ fontReader read.=0D fontReader close.=0D=0D "{xTable. glyphs. =
> minAscii. maxAscii. maxWidth. ascent. descent. pointSize} _ fontReader =
> read."=0D xTable _ a at: 1.=0D glyphs _ a at: 2.=0D minAscii _ a at: =
> 3.=0D =0D "See CharacterScanner>>characterNotInFont. maxAscii+1 must be =
> a legal Character."=0D maxAscii _ (a at: 4) min: 255.=0D=0D maxWidth _ a =
> at: 5.=0D ascent _ a at: 6.=0D descent _ a at: 7.=0D pointSize _ a at: =
> 8.=0D=0D name _ aString.=0D=0D type _ 0. "no one see this"=0D =
> superscript _ ascent - descent // 3. =0D subscript _ descent - ascent // =
> 3. =0D emphasis _ 0.=0D self reset.! !=0D=0D=
>
> --Boundary_(ID_77N+zAbuddL4HYWk2eu0bQ)
> MIME-version: 1.0
> Content-type: text/plain; charset=us-ascii
> Content-transfer-encoding: 7BIT
>
>
>
> --Boundary_(ID_77N+zAbuddL4HYWk2eu0bQ)--
More information about the Squeak-dev
mailing list
|