Fixed-Width Font

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
55 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Hannes Hirzel
On 7/11/15, Juan Vuletich <[hidden email]> wrote:

> On 7/10/2015 11:20 AM, Dan Norton wrote:
>> ...
>> Browsing through strike fonts, I see no fixed widths. But, true type fonts
>> have a few
>> fixed-width examples. There seems to be no way to install a .ttf in Cuis
>> currently.
>>
>> Can we port TrueType-Support from Squeak?
>>
>> Should there be a sibling of StrikeFont, say TrueTypeFont, which inherits
>> from AbstractFont?
>>
>> Any hints or guidance would be most welcomed.
>>
>
> I'd say, stick to StrikeFonts, and learn to build new ones. I the other
> message I just sent, I included more details.

+1

or copy a strikefont from Squeak. The Squeak wiki has a lot of
material about Strikefont.



> Cheers,
> Juan Vuletich
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Dan Norton
In reply to this post by Dan Norton
Correction:

Currently I am porting TrueType. By way of a progress report, drag has been reduced and by
installing /the TrueType package from:/

https://github.com/dhnorton/Cuis-Smalltalk-fonts

etc.
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Hannes Hirzel
https://github.com/dhnorton/Cuis-Smalltalk-fonts/blob/master/Graphics-Text.pck.st#L2

says

    "Description A stripped-down package with changes only to
AbstractFont and StrikeFont."

I assume the code is from the current Squeak 4.6?

--HH

On 7/18/15, Dan Norton <[hidden email]> wrote:

> Correction:
>
> Currently I am porting TrueType. By way of a progress report, drag has been
> reduced and by
> installing /the TrueType package from:/
>
> https://github.com/dhnorton/Cuis-Smalltalk-fonts
>
> etc.
>
>
>
> --
> View this message in context:
> http://forum.world.st/Fixed-Width-Font-tp4836695p4838103.html
> Sent from the Cuis Smalltalk mailing list archive at Nabble.com.
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Dan Norton
On 18 Jul 2015 at 19:10, H. Hirzel wrote:

> https://github.com/dhnorton/Cuis-Smalltalk-fonts/blob/master/Graphic
> s-Text.pck.st#L2
>
> says
>
>     "Description A stripped-down package with changes only to
> AbstractFont and StrikeFont."
>
> I assume the code is from the current Squeak 4.6?
>
> --HH
>

No, Squeak 4.5.

 - Dan

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Dan Norton
In reply to this post by Hannes Hirzel
On 18 Jul 2015 at 19:10, H. Hirzel wrote:

> https://github.com/dhnorton/Cuis-Smalltalk-fonts/blob/master/Graphic
> s-Text.pck.st#L2
>
> says
>
>     "Description A stripped-down package with changes only to
> AbstractFont and StrikeFont."
>
> I assume the code is from the current Squeak 4.6?
>
> --HH
>

Actually, the code is from Cuis, now that I take a closer look.

 - Dan

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Juan Vuletich-4
In reply to this post by Dan Norton
On 7/18/2015 3:37 PM, Dan Norton wrote:

> On 11 Jul 2015 at 13:40, Juan Vuletich wrote:
>
>> Hi Folks,
>>
>> It is not too hard to build new StrikeFonts. You need to build, by
>> hand,
>> files like the ones in here:
>> https://dl.dropboxusercontent.com/u/13285702/BitmapDejaVuAllSizes.zi
>> p
>> and learn a bit about stuff like #installDejaVu2 . Maybe it was with
>> this method and the files in this zip that built the existing
>> instances
>> of StrikeFont. Not sure.
>>
> That's intrigueing but I can't reproduce it. Maybe the .bmp but where did you get the .txt?
>
>   - Dan

I wrote them with a text editor. Check #installDejaVu2 and really try to
understand how StrikeFonts work and how they are built with this method.
Maybe you'll become enlightened.

Cheers,
Juan Vuletich

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Dan Norton
On 19 Jul 2015 at 10:31, Juan Vuletich wrote:

> On 7/18/2015 3:37 PM, Dan Norton wrote:
> > On 11 Jul 2015 at 13:40, Juan Vuletich wrote:
> >
> >> Hi Folks,
> >>
> >> It is not too hard to build new StrikeFonts. You need to build,
> by
> >> hand,
> >> files like the ones in here:
> >>
> https://dl.dropboxusercontent.com/u/13285702/BitmapDejaVuAllSizes.zi
> >> p
> >> and learn a bit about stuff like #installDejaVu2 . Maybe it was
> with
> >> this method and the files in this zip that built the existing
> >> instances
> >> of StrikeFont. Not sure.
> >>
> > That's intrigueing but I can't reproduce it. Maybe the .bmp but
> where did you get the .txt?
> >
> >   - Dan
>
> I wrote them with a text editor. Check #installDejaVu2 and really
> try to
> understand how StrikeFonts work and how they are built with this
> method.
> Maybe you'll become enlightened.
>

A StrikeFont consists of a characterToGlyphMap, xTable, glyphs, name, and several scalars. StrikeFont class methods create fonts by processing file pairs assumed to be in the "AAFonts" subdirectory. For example:

DejaVu Sans Oblique 14.bmp
DejaVu Sans Oblique 14.txt

Is one such pair providing the italic (oblique) style for 14-point size. There is a pair for every font size and style: base, bold, italic, and bold italic. Therefore a font such as "DejaVu Sans" which is available in the size interval 5 to 24 requires 160 files. The file names are stylized and encoded in the StrikeFont class methods.

Glyphs come from the .bmp file. The .txt file is a string of numbers; the first three specify pointSize, ascent, and descent. The rest of the numbers in the .txt file are used to form the xTable, which is the index into the glyphs for a character. The characterToGlyphMap is an array of 256 entries which map a character's ascii value to the xTable and thence to the glyphs.

The bold, italic, and bold italic styles are stashed as derivatives of the base and not selectable from the current menus.

StrikeFont is a subclass of AbstractFont, which has class variables AvailableFonts and DefaultFont.

If it can't find a file, StrikeFont will loop.

In regard to creating the .bmp and .txt files, you say, " I wrote them with a text editor." Please tell me which text editor you used. None of mine do that.

 - Dan
  

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Hannes Hirzel
On 7/20/15, Dan Norton <[hidden email]> wrote:

> On 19 Jul 2015 at 10:31, Juan Vuletich wrote:
>
>> On 7/18/2015 3:37 PM, Dan Norton wrote:
>> > On 11 Jul 2015 at 13:40, Juan Vuletich wrote:
>> >
>> >> Hi Folks,
>> >>
>> >> It is not too hard to build new StrikeFonts. You need to build,
>> by
>> >> hand,
>> >> files like the ones in here:
>> >>
>> https://dl.dropboxusercontent.com/u/13285702/BitmapDejaVuAllSizes.zi
>> >> p
>> >> and learn a bit about stuff like #installDejaVu2 . Maybe it was
>> with
>> >> this method and the files in this zip that built the existing
>> >> instances
>> >> of StrikeFont. Not sure.
>> >>
>> > That's intrigueing but I can't reproduce it. Maybe the .bmp but
>> where did you get the .txt?
>> >
>> >   - Dan
>>
>> I wrote them with a text editor. Check #installDejaVu2 and really
>> try to
>> understand how StrikeFonts work and how they are built with this
>> method.
>> Maybe you'll become enlightened.
>>
>
> A StrikeFont consists of a characterToGlyphMap, xTable, glyphs, name, and
> several scalars.
> StrikeFont class methods create fonts by processing file pairs assumed to be
> in the
> "AAFonts" subdirectory. For example:
>
> DejaVu Sans Oblique 14.bmp
> DejaVu Sans Oblique 14.txt
>
> Is one such pair providing the italic (oblique) style for 14-point size.
> There is a pair for every
> font size and style: base, bold, italic, and bold italic. Therefore a font
> such as "DejaVu Sans"
> which is available in the size interval 5 to 24 requires 160 files. The file
> names are stylized
> and encoded in the StrikeFont class methods.
>
> Glyphs come from the .bmp file. The .txt file is a string of numbers; the
> first three specify
> pointSize, ascent, and descent. The rest of the numbers in the .txt file are
> used to form the
> xTable, which is the index into the glyphs for a character. The
> characterToGlyphMap is an
> array of 256 entries which map a character's ascii value to the xTable and
> thence to the
> glyphs.
>
> The bold, italic, and bold italic styles are stashed as derivatives of the
> base and not
> selectable from the current menus.
>
> StrikeFont is a subclass of AbstractFont, which has class variables
> AvailableFonts and
> DefaultFont.
>
> If it can't find a file, StrikeFont will loop.
>
> In regard to creating the .bmp and .txt files, you say, "I wrote them with a
> text editor." Please
> tell me which text editor you used. None of mine do that.
>
>  - Dan

What I used in the past is the StrikeFont bitmap editor which is in
Squeak. In MVC if I remember well. So an early version of Squeak (e.g.
3.8.1 Oct 2006)  is helpful.

These versions are very accessible these days  http://squeak.org/downloads/

--Hannes

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Juan Vuletich-4
In reply to this post by Dan Norton
Hi Dan,

On 7/19/2015 10:13 PM, Dan Norton wrote:
On 19 Jul 2015 at 10:31, Juan Vuletich wrote:

> On 7/18/2015 3:37 PM, Dan Norton wrote:
> > On 11 Jul 2015 at 13:40, Juan Vuletich wrote:
> >
> >> Hi Folks,
> >>
> >> It is not too hard to build new StrikeFonts. You need to build,
> by
> >> hand,
> >> files like the ones in here:
> >>
> >> p
> >> and learn a bit about stuff like #installDejaVu2 . Maybe it was
> with
> >> this method and the files in this zip that built the existing
> >> instances
> >> of StrikeFont. Not sure.
> >>
> > That's intrigueing but I can't reproduce it. Maybe the .bmp but
> where did you get the .txt?
> >
> >   - Dan
>
> I wrote them with a text editor. Check #installDejaVu2 and really
> try to
> understand how StrikeFonts work and how they are built with this
> method.
> Maybe you'll become enlightened.
>

A StrikeFont consists of a characterToGlyphMap, xTable, glyphs, name, and several scalars. StrikeFont class methods create fonts by processing file pairs assumed to be in the "AAFonts" subdirectory. For example:

DejaVu Sans Oblique 14.bmp
DejaVu Sans Oblique 14.txt

Is one such pair providing the italic (oblique) style for 14-point size. There is a pair for every font size and style: base, bold, italic, and bold italic. Therefore a font such as "DejaVu Sans" which is available in the size interval 5 to 24 requires 160 files. The file names are stylized and encoded in the StrikeFont class methods.

Glyphs come from the .bmp file. The .txt file is a string of numbers; the first three specify pointSize, ascent, and descent. The rest of the numbers in the .txt file are used to form the xTable, which is the index into the glyphs for a character. The characterToGlyphMap is an array of 256 entries which map a character's ascii value to the xTable and thence to the glyphs.

The bold, italic, and bold italic styles are stashed as derivatives of the base and not selectable from the current menus.

StrikeFont is a subclass of AbstractFont, which has class variables AvailableFonts and DefaultFont.

If it can't find a file, StrikeFont will loop.

Great! You got it all.

In regard to creating the .bmp and .txt files, you say, " I wrote them with a text editor." Please tell me which text editor you used. None of mine do that.

The bmp files can be created with screen capture program, after entering suitable text in it. Maybe you need to stitch several pieces together, etc. WRT the txt files, well, the editor didn't do it for me. I wrote them. I _typed_ them. Maybe I used some (long lost) code to look for white columns separating glyphs, but I'm not really sure. #xTallyPixelValue:orNot: and friends are great for this kind of stuff.

In any case, it will be easier for you, as you want a monospaced font. Printing something like (32 to: 255) collect: [ :ascii | ascii-32 * 9 ] into the file might be enough.

You have all the pieces at hand. it just requires a bit of patience.

Cheers,
Juan Vuletich

 - Dan
 


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Hannes Hirzel
https://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format

The Glyph Bitmap Distribution Format (BDF) by Adobe is a file format
for storing bitmap fonts. The content takes the form of a text file
intended to be human- and computer-readable. BDF is typically used in
Unix X Window environments.

Squeak contains a BDFFontReader

<class comment>
I am a conversion utility for reading X11 Bitmap Distribution Format
fonts.  My code is derived from the multilingual Squeak changeset
written by OHSHIMA Yoshiki ([hidden email]), although all
support for fonts with more than 256 glyphs has been ripped out.  See
http://www.is.titech.ac.jp/~ohshima/squeak/squeak-multilingual-e.html
.

My class methods contain tools for fetching BDF source files from a
well-known archive site, batch conversion to Squeak's .sf2 format, and
installation of these fonts as TextStyles.  Also, the legal notices
for the standard 75dpi fonts I process this way are included as
"x11FontLegalNotices'.
</class comment>

The URL no longer works, but the Squeak wiki

http://wiki.squeak.org/squeak/696

has more on fonts.

I have loaded BDF fonts into Squeak in the past and I assume the
Squeak StrikeFonts and the Cuis StrikeFonts are still compatible.

--Hannes

On 7/20/15, Juan Vuletich <[hidden email]> wrote:

> Hi Dan,
>
> On 7/19/2015 10:13 PM, Dan Norton wrote:
>> On 19 Jul 2015 at 10:31, Juan Vuletich wrote:
>>
>> > On 7/18/2015 3:37 PM, Dan Norton wrote:
>> > > On 11 Jul 2015 at 13:40, Juan Vuletich wrote:
>> > >
>> > >> Hi Folks,
>> > >>
>> > >> It is not too hard to build new StrikeFonts. You need to build,
>> > by
>> > >> hand,
>> > >> files like the ones in here:
>> > >>
>> > https://dl.dropboxusercontent.com/u/13285702/BitmapDejaVuAllSizes.zi
>> > >> p
>> > >> and learn a bit about stuff like #installDejaVu2 . Maybe it was
>> > with
>> > >> this method and the files in this zip that built the existing
>> > >> instances
>> > >> of StrikeFont. Not sure.
>> > >>
>> > > That's intrigueing but I can't reproduce it. Maybe the .bmp but
>> > where did you get the .txt?
>> > >
>> > >   - Dan
>> >
>> > I wrote them with a text editor. Check #installDejaVu2 and really
>> > try to
>> > understand how StrikeFonts work and how they are built with this
>> > method.
>> > Maybe you'll become enlightened.
>> >
>>
>> A StrikeFont consists of a characterToGlyphMap, xTable, glyphs, name,
>> and several scalars. StrikeFont class methods create fonts by
>> processing file pairs assumed to be in the "AAFonts" subdirectory. For
>> example:
>>
>> DejaVu Sans Oblique 14.bmp
>> DejaVu Sans Oblique 14.txt
>>
>> Is one such pair providing the italic (oblique) style for 14-point
>> size. There is a pair for every font size and style: base, bold,
>> italic, and bold italic. Therefore a font such as "DejaVu Sans" which
>> is available in the size interval 5 to 24 requires 160 files. The file
>> names are stylized and encoded in the StrikeFont class methods.
>>
>> Glyphs come from the .bmp file. The .txt file is a string of numbers;
>> the first three specify pointSize, ascent, and descent. The rest of
>> the numbers in the .txt file are used to form the xTable, which is the
>> index into the glyphs for a character. The characterToGlyphMap is an
>> array of 256 entries which map a character's ascii value to the xTable
>> and thence to the glyphs.
>>
>> The bold, italic, and bold italic styles are stashed as derivatives of
>> the base and not selectable from the current menus.
>>
>> StrikeFont is a subclass of AbstractFont, which has class variables
>> AvailableFonts and DefaultFont.
>>
>> If it can't find a file, StrikeFont will loop.
>
> Great! You got it all.
>
>> In regard to creating the .bmp and .txt files, you say, " I wrote them
>> with a text editor." Please tell me which text editor you used. None
>> of mine do that.
>
> The bmp files can be created with screen capture program, after entering
> suitable text in it. Maybe you need to stitch several pieces together,
> etc. WRT the txt files, well, the editor didn't do it for me. I wrote
> them. I _typed_ them. Maybe I used some (long lost) code to look for
> white columns separating glyphs, but I'm not really sure.
> #xTallyPixelValue:orNot: and friends are great for this kind of stuff.
>
> In any case, it will be easier for you, as you want a monospaced font.
> Printing something like (32 to: 255) collect: [ :ascii | ascii-32 * 9 ]
> into the file might be enough.
>
> You have all the pieces at hand. it just requires a bit of patience.
>
> Cheers,
> Juan Vuletich
>
>>  - Dan
>>
>
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Dan Norton
In reply to this post by Juan Vuletich-4
On 20 Jul 2015 at 19:33, Juan Vuletich wrote:

>
> Hi Dan,
>
> On 7/19/2015 10:13 PM, Dan Norton wrote:
>     On 19 Jul 2015 at 10:31, Juan Vuletich wrote:
>
>     > On 7/18/2015 3:37 PM, Dan Norton wrote:
>     > > On 11 Jul 2015 at 13:40, Juan Vuletich wrote:
>     > >
>     > >> Hi Folks,
>     > >>
>     > >> It is not too hard to build new StrikeFonts. You need to
> build,
>     > by
>     > >> hand,
>     > >> files like the ones in here:
>     > >>
>     >
> https://dl.dropboxusercontent.com/u/13285702/BitmapDejaVuAllSizes.zi
>     > >> p
>     > >> and learn a bit about stuff like #installDejaVu2 . Maybe it
> was
>     > with
>     > >> this method and the files in this zip that built the
> existing
>     > >> instances
>     > >> of StrikeFont. Not sure.
>     > >>
>     > > That's intrigueing but I can't reproduce it. Maybe the .bmp
> but
>     > where did you get the .txt?
>     > >
>     > >   - Dan
>     >
>     > I wrote them with a text editor. Check #installDejaVu2 and
> really
>     > try to
>     > understand how StrikeFonts work and how they are built with
> this
>     > method.
>     > Maybe you'll become enlightened.
>     >
>
>     A StrikeFont consists of a characterToGlyphMap, xTable, glyphs,
> name, and several
>     scalars. StrikeFont class methods create fonts by processing
> file pairs assumed to be in the
>     "AAFonts" subdirectory. For example:
>
>     DejaVu Sans Oblique 14.bmp
>     DejaVu Sans Oblique 14.txt
>
>     Is one such pair providing the italic (oblique) style for
> 14-point size. There is a pair for every
>     font size and style: base, bold, italic, and bold italic.
> Therefore a font such as "DejaVu Sans"
>     which is available in the size interval 5 to 24 requires 160
> files. The file names are stylized
>     and encoded in the StrikeFont class methods.
>
>     Glyphs come from the .bmp file. The .txt file is a string of
> numbers; the first three specify
>     pointSize, ascent, and descent. The rest of the numbers in the
> .txt file are used to form the
>     xTable, which is the index into the glyphs for a character. The
> characterToGlyphMap is an
>     array of 256 entries which map a character's ascii value to the
> xTable and thence to the
>     glyphs.
>
>     The bold, italic, and bold italic styles are stashed as
> derivatives of the base and not
>     selectable from the current menus.
>
>     StrikeFont is a subclass of AbstractFont, which has class
> variables AvailableFonts and
>     DefaultFont.
>
>     If it can't find a file, StrikeFont will loop.
>
> Great! You got it all.
>
>     In regard to creating the .bmp and .txt files, you say, " I
> wrote them with a text editor."
>     Please tell me which text editor you used. None of mine do
> that.
>
> The bmp files can be created with screen capture program, after
> entering suitable text in it. Maybe
> you need to stitch several pieces together, etc. WRT the txt files,
> well, the editor didn't do it for
> me. I wrote them. I _typed_ them. Maybe I used some (long lost) code
> to look for white columns
> separating glyphs, but I'm not really sure. #xTallyPixelValue:orNot:
> and friends are great for this
> kind of stuff.
>
> In any case, it will be easier for you, as you want a monospaced
> font. Printing something like (32
> to: 255) collect: [ :ascii | ascii-32 * 9 ] into the file might be
> enough.
>
> You have all the pieces at hand. it just requires a bit of
> patience.
>

Encouraged by this, I have tried cobbling a fixed-width StrikeFont from Courier New which comes with Windows7. At this point, if some kind of fixed-width smudges would appear then it would be progress. Here's where I am:

The immediate problem is an error: 'Unsupported format. Try "Graphics-Files-Additional.pck.st".' which arises when ImageReadWriter class>>formFromStream: examines the .bmp file.

Higher in the context, Form class>>fromBinaryStream: has firstByte = 66 which I mention because of the way the .bmp file was made. Here is the process I used, from the bottom up:

ImageMagick freeware produces the glyphs but with something stubbornly prepended. The command line is:
           convert -font \windows\fonts\cour.ttf -pointsize 12 label:@characters.txt courier12.bmp

Using NotePad, save characters.txt with encoding: UTF-8.

Paste the character string onto a NotePad

Copy the character string.

In a Cuis workspace print:
           str := String new writeStream.
           (32 to: 255) do: [ :n | str nextPut: n asCharacter]
           str contents.

Code package and files allegedly for courier strike fonts are attached if you're interested.

 - Dan
 

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org

CourierExample.zip (33K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Hannes Hirzel
I would try to save the *.bmp file as a *.gif file in Microsoft Paint
and then try to load it with

ImageReadWriter class>>formFromStream:

HTH

--HH

On 7/24/15, Dan Norton <[hidden email]> wrote:

> On 20 Jul 2015 at 19:33, Juan Vuletich wrote:
>
>>
>> Hi Dan,
>>
>> On 7/19/2015 10:13 PM, Dan Norton wrote:
>>     On 19 Jul 2015 at 10:31, Juan Vuletich wrote:
>>
>>     > On 7/18/2015 3:37 PM, Dan Norton wrote:
>>     > > On 11 Jul 2015 at 13:40, Juan Vuletich wrote:
>>     > >
>>     > >> Hi Folks,
>>     > >>
>>     > >> It is not too hard to build new StrikeFonts. You need to
>> build,
>>     > by
>>     > >> hand,
>>     > >> files like the ones in here:
>>     > >>
>>     >
>> https://dl.dropboxusercontent.com/u/13285702/BitmapDejaVuAllSizes.zi
>>     > >> p
>>     > >> and learn a bit about stuff like #installDejaVu2 . Maybe it
>> was
>>     > with
>>     > >> this method and the files in this zip that built the
>> existing
>>     > >> instances
>>     > >> of StrikeFont. Not sure.
>>     > >>
>>     > > That's intrigueing but I can't reproduce it. Maybe the .bmp
>> but
>>     > where did you get the .txt?
>>     > >
>>     > >   - Dan
>>     >
>>     > I wrote them with a text editor. Check #installDejaVu2 and
>> really
>>     > try to
>>     > understand how StrikeFonts work and how they are built with
>> this
>>     > method.
>>     > Maybe you'll become enlightened.
>>     >
>>
>>     A StrikeFont consists of a characterToGlyphMap, xTable, glyphs,
>> name, and several
>>     scalars. StrikeFont class methods create fonts by processing
>> file pairs assumed to be in the
>>     "AAFonts" subdirectory. For example:
>>
>>     DejaVu Sans Oblique 14.bmp
>>     DejaVu Sans Oblique 14.txt
>>
>>     Is one such pair providing the italic (oblique) style for
>> 14-point size. There is a pair for every
>>     font size and style: base, bold, italic, and bold italic.
>> Therefore a font such as "DejaVu Sans"
>>     which is available in the size interval 5 to 24 requires 160
>> files. The file names are stylized
>>     and encoded in the StrikeFont class methods.
>>
>>     Glyphs come from the .bmp file. The .txt file is a string of
>> numbers; the first three specify
>>     pointSize, ascent, and descent. The rest of the numbers in the
>> .txt file are used to form the
>>     xTable, which is the index into the glyphs for a character. The
>> characterToGlyphMap is an
>>     array of 256 entries which map a character's ascii value to the
>> xTable and thence to the
>>     glyphs.
>>
>>     The bold, italic, and bold italic styles are stashed as
>> derivatives of the base and not
>>     selectable from the current menus.
>>
>>     StrikeFont is a subclass of AbstractFont, which has class
>> variables AvailableFonts and
>>     DefaultFont.
>>
>>     If it can't find a file, StrikeFont will loop.
>>
>> Great! You got it all.
>>
>>     In regard to creating the .bmp and .txt files, you say, " I
>> wrote them with a text editor."
>>     Please tell me which text editor you used. None of mine do
>> that.
>>
>> The bmp files can be created with screen capture program, after
>> entering suitable text in it. Maybe
>> you need to stitch several pieces together, etc. WRT the txt files,
>> well, the editor didn't do it for
>> me. I wrote them. I _typed_ them. Maybe I used some (long lost) code
>> to look for white columns
>> separating glyphs, but I'm not really sure. #xTallyPixelValue:orNot:
>> and friends are great for this
>> kind of stuff.
>>
>> In any case, it will be easier for you, as you want a monospaced
>> font. Printing something like (32
>> to: 255) collect: [ :ascii | ascii-32 * 9 ] into the file might be
>> enough.
>>
>> You have all the pieces at hand. it just requires a bit of
>> patience.
>>
>
> Encouraged by this, I have tried cobbling a fixed-width StrikeFont from
> Courier New which
> comes with Windows7. At this point, if some kind of fixed-width smudges
> would appear then
> it would be progress. Here's where I am:
>
> The immediate problem is an error: 'Unsupported format. Try
> "Graphics-Files-Additional.pck.st".' which arises when ImageReadWriter
> class>>formFromStream: examines the .bmp file.
>
> Higher in the context, Form class>>fromBinaryStream: has firstByte = 66
> which I mention
> because of the way the .bmp file was made. Here is the process I used, from
> the bottom up:
>
> ImageMagick freeware produces the glyphs but with something stubbornly
> prepended. The
> command line is:
> convert -font \windows\fonts\cour.ttf -pointsize 12 label:@characters.txt
> courier12.bmp
>
> Using NotePad, save characters.txt with encoding: UTF-8.
>
> Paste the character string onto a NotePad
>
> Copy the character string.
>
> In a Cuis workspace print:
> str := String new writeStream.
> (32 to: 255) do: [ :n | str nextPut: n asCharacter]
> str contents.
>
> Code package and files allegedly for courier strike fonts are attached if
> you're
> interested.
>
>  - Dan
>
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Hannes Hirzel
I did the StrikeFont exercises in Squeak. So it could be that Squeak
has a BMP file reader which is no longer included in Cuis. A thing to
check....

--HH

On 7/25/15, H. Hirzel <[hidden email]> wrote:

> I would try to save the *.bmp file as a *.gif file in Microsoft Paint
> and then try to load it with
>
> ImageReadWriter class>>formFromStream:
>
> HTH
>
> --HH
>
> On 7/24/15, Dan Norton <[hidden email]> wrote:
>> On 20 Jul 2015 at 19:33, Juan Vuletich wrote:
>>
>>>
>>> Hi Dan,
>>>
>>> On 7/19/2015 10:13 PM, Dan Norton wrote:
>>>     On 19 Jul 2015 at 10:31, Juan Vuletich wrote:
>>>
>>>     > On 7/18/2015 3:37 PM, Dan Norton wrote:
>>>     > > On 11 Jul 2015 at 13:40, Juan Vuletich wrote:
>>>     > >
>>>     > >> Hi Folks,
>>>     > >>
>>>     > >> It is not too hard to build new StrikeFonts. You need to
>>> build,
>>>     > by
>>>     > >> hand,
>>>     > >> files like the ones in here:
>>>     > >>
>>>     >
>>> https://dl.dropboxusercontent.com/u/13285702/BitmapDejaVuAllSizes.zi
>>>     > >> p
>>>     > >> and learn a bit about stuff like #installDejaVu2 . Maybe it
>>> was
>>>     > with
>>>     > >> this method and the files in this zip that built the
>>> existing
>>>     > >> instances
>>>     > >> of StrikeFont. Not sure.
>>>     > >>
>>>     > > That's intrigueing but I can't reproduce it. Maybe the .bmp
>>> but
>>>     > where did you get the .txt?
>>>     > >
>>>     > >   - Dan
>>>     >
>>>     > I wrote them with a text editor. Check #installDejaVu2 and
>>> really
>>>     > try to
>>>     > understand how StrikeFonts work and how they are built with
>>> this
>>>     > method.
>>>     > Maybe you'll become enlightened.
>>>     >
>>>
>>>     A StrikeFont consists of a characterToGlyphMap, xTable, glyphs,
>>> name, and several
>>>     scalars. StrikeFont class methods create fonts by processing
>>> file pairs assumed to be in the
>>>     "AAFonts" subdirectory. For example:
>>>
>>>     DejaVu Sans Oblique 14.bmp
>>>     DejaVu Sans Oblique 14.txt
>>>
>>>     Is one such pair providing the italic (oblique) style for
>>> 14-point size. There is a pair for every
>>>     font size and style: base, bold, italic, and bold italic.
>>> Therefore a font such as "DejaVu Sans"
>>>     which is available in the size interval 5 to 24 requires 160
>>> files. The file names are stylized
>>>     and encoded in the StrikeFont class methods.
>>>
>>>     Glyphs come from the .bmp file. The .txt file is a string of
>>> numbers; the first three specify
>>>     pointSize, ascent, and descent. The rest of the numbers in the
>>> .txt file are used to form the
>>>     xTable, which is the index into the glyphs for a character. The
>>> characterToGlyphMap is an
>>>     array of 256 entries which map a character's ascii value to the
>>> xTable and thence to the
>>>     glyphs.
>>>
>>>     The bold, italic, and bold italic styles are stashed as
>>> derivatives of the base and not
>>>     selectable from the current menus.
>>>
>>>     StrikeFont is a subclass of AbstractFont, which has class
>>> variables AvailableFonts and
>>>     DefaultFont.
>>>
>>>     If it can't find a file, StrikeFont will loop.
>>>
>>> Great! You got it all.
>>>
>>>     In regard to creating the .bmp and .txt files, you say, " I
>>> wrote them with a text editor."
>>>     Please tell me which text editor you used. None of mine do
>>> that.
>>>
>>> The bmp files can be created with screen capture program, after
>>> entering suitable text in it. Maybe
>>> you need to stitch several pieces together, etc. WRT the txt files,
>>> well, the editor didn't do it for
>>> me. I wrote them. I _typed_ them. Maybe I used some (long lost) code
>>> to look for white columns
>>> separating glyphs, but I'm not really sure. #xTallyPixelValue:orNot:
>>> and friends are great for this
>>> kind of stuff.
>>>
>>> In any case, it will be easier for you, as you want a monospaced
>>> font. Printing something like (32
>>> to: 255) collect: [ :ascii | ascii-32 * 9 ] into the file might be
>>> enough.
>>>
>>> You have all the pieces at hand. it just requires a bit of
>>> patience.
>>>
>>
>> Encouraged by this, I have tried cobbling a fixed-width StrikeFont from
>> Courier New which
>> comes with Windows7. At this point, if some kind of fixed-width smudges
>> would appear then
>> it would be progress. Here's where I am:
>>
>> The immediate problem is an error: 'Unsupported format. Try
>> "Graphics-Files-Additional.pck.st".' which arises when ImageReadWriter
>> class>>formFromStream: examines the .bmp file.
>>
>> Higher in the context, Form class>>fromBinaryStream: has firstByte = 66
>> which I mention
>> because of the way the .bmp file was made. Here is the process I used,
>> from
>> the bottom up:
>>
>> ImageMagick freeware produces the glyphs but with something stubbornly
>> prepended. The
>> command line is:
>> convert -font \windows\fonts\cour.ttf -pointsize 12
>> label:@characters.txt
>> courier12.bmp
>>
>> Using NotePad, save characters.txt with encoding: UTF-8.
>>
>> Paste the character string onto a NotePad
>>
>> Copy the character string.
>>
>> In a Cuis workspace print:
>> str := String new writeStream.
>> (32 to: 255) do: [ :n | str nextPut: n asCharacter]
>> str contents.
>>
>> Code package and files allegedly for courier strike fonts are attached if
>> you're
>> interested.
>>
>>  - Dan
>>
>>
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Dan Norton
Form class>>fromBinaryStream: has firstByte = 66, this is not an error but part of "BM" in the header of the .bmp file.

The "Unsupported format..." error is caused by Cuis wanting biSize = 40 and ImageMagick
putting a different value.

Squeak has BitstreamVeraSansMono, a fixed-width font. Why couldn't  that be used to
produce .bmp files instead of ImageMagick? The BM header would be compatible with Cuis
AFAIKT and it might get us a fixed-width font on Cuis.

On 25 Jul 2015 at 13:14, H. Hirzel wrote:

> I did the StrikeFont exercises in Squeak. So it could be that
> Squeak
> has a BMP file reader which is no longer included in Cuis. A thing
> to
> check....
>
> --HH
>
> On 7/25/15, H. Hirzel <[hidden email]> wrote:
> > I would try to save the *.bmp file as a *.gif file in Microsoft
> Paint
> > and then try to load it with
> >
> > ImageReadWriter class>>formFromStream:
> >
> > HTH
> >
> > --HH
> >
> > On 7/24/15, Dan Norton <[hidden email]> wrote:
> >> On 20 Jul 2015 at 19:33, Juan Vuletich wrote:
> >>
> >>>
> >>> Hi Dan,
> >>>
> >>> On 7/19/2015 10:13 PM, Dan Norton wrote:
> >>>     On 19 Jul 2015 at 10:31, Juan Vuletich wrote:
> >>>
> >>>     > On 7/18/2015 3:37 PM, Dan Norton wrote:
> >>>     > > On 11 Jul 2015 at 13:40, Juan Vuletich wrote:
> >>>     > >
> >>>     > >> Hi Folks,
> >>>     > >>
> >>>     > >> It is not too hard to build new StrikeFonts. You need
> to
> >>> build,
> >>>     > by
> >>>     > >> hand,
> >>>     > >> files like the ones in here:
> >>>     > >>
> >>>     >
> >>>
> https://dl.dropboxusercontent.com/u/13285702/BitmapDejaVuAllSizes.zi
> >>>     > >> p
> >>>     > >> and learn a bit about stuff like #installDejaVu2 .
> Maybe it
> >>> was
> >>>     > with
> >>>     > >> this method and the files in this zip that built the
> >>> existing
> >>>     > >> instances
> >>>     > >> of StrikeFont. Not sure.
> >>>     > >>
> >>>     > > That's intrigueing but I can't reproduce it. Maybe the
> .bmp
> >>> but
> >>>     > where did you get the .txt?
> >>>     > >
> >>>     > >   - Dan
> >>>     >
> >>>     > I wrote them with a text editor. Check #installDejaVu2
> and
> >>> really
> >>>     > try to
> >>>     > understand how StrikeFonts work and how they are built
> with
> >>> this
> >>>     > method.
> >>>     > Maybe you'll become enlightened.
> >>>     >
> >>>
> >>>     A StrikeFont consists of a characterToGlyphMap, xTable,
> glyphs,
> >>> name, and several
> >>>     scalars. StrikeFont class methods create fonts by
> processing
> >>> file pairs assumed to be in the
> >>>     "AAFonts" subdirectory. For example:
> >>>
> >>>     DejaVu Sans Oblique 14.bmp
> >>>     DejaVu Sans Oblique 14.txt
> >>>
> >>>     Is one such pair providing the italic (oblique) style for
> >>> 14-point size. There is a pair for every
> >>>     font size and style: base, bold, italic, and bold italic.
> >>> Therefore a font such as "DejaVu Sans"
> >>>     which is available in the size interval 5 to 24 requires
> 160
> >>> files. The file names are stylized
> >>>     and encoded in the StrikeFont class methods.
> >>>
> >>>     Glyphs come from the .bmp file. The .txt file is a string
> of
> >>> numbers; the first three specify
> >>>     pointSize, ascent, and descent. The rest of the numbers in
> the
> >>> .txt file are used to form the
> >>>     xTable, which is the index into the glyphs for a character.
> The
> >>> characterToGlyphMap is an
> >>>     array of 256 entries which map a character's ascii value to
> the
> >>> xTable and thence to the
> >>>     glyphs.
> >>>
> >>>     The bold, italic, and bold italic styles are stashed as
> >>> derivatives of the base and not
> >>>     selectable from the current menus.
> >>>
> >>>     StrikeFont is a subclass of AbstractFont, which has class
> >>> variables AvailableFonts and
> >>>     DefaultFont.
> >>>
> >>>     If it can't find a file, StrikeFont will loop.
> >>>
> >>> Great! You got it all.
> >>>
> >>>     In regard to creating the .bmp and .txt files, you say, "
> I
> >>> wrote them with a text editor."
> >>>     Please tell me which text editor you used. None of mine do
> >>> that.
> >>>
> >>> The bmp files can be created with screen capture program,
> after
> >>> entering suitable text in it. Maybe
> >>> you need to stitch several pieces together, etc. WRT the txt
> files,
> >>> well, the editor didn't do it for
> >>> me. I wrote them. I _typed_ them. Maybe I used some (long lost)
> code
> >>> to look for white columns
> >>> separating glyphs, but I'm not really sure.
> #xTallyPixelValue:orNot:
> >>> and friends are great for this
> >>> kind of stuff.
> >>>
> >>> In any case, it will be easier for you, as you want a
> monospaced
> >>> font. Printing something like (32
> >>> to: 255) collect: [ :ascii | ascii-32 * 9 ] into the file might
> be
> >>> enough.
> >>>
> >>> You have all the pieces at hand. it just requires a bit of
> >>> patience.
> >>>
> >>
> >> Encouraged by this, I have tried cobbling a fixed-width
> StrikeFont from
> >> Courier New which
> >> comes with Windows7. At this point, if some kind of fixed-width
> smudges
> >> would appear then
> >> it would be progress. Here's where I am:
> >>
> >> The immediate problem is an error: 'Unsupported format. Try
> >> "Graphics-Files-Additional.pck.st".' which arises when
> ImageReadWriter
> >> class>>formFromStream: examines the .bmp file.
> >>
> >> Higher in the context, Form class>>fromBinaryStream: has
> firstByte = 66
> >> which I mention
> >> because of the way the .bmp file was made. Here is the process I
> used,
> >> from
> >> the bottom up:
> >>
> >> ImageMagick freeware produces the glyphs but with something
> stubbornly
> >> prepended. The
> >> command line is:
> >> convert -font \windows\fonts\cour.ttf -pointsize 12
> >> label:@characters.txt
> >> courier12.bmp
> >>
> >> Using NotePad, save characters.txt with encoding: UTF-8.
> >>
> >> Paste the character string onto a NotePad
> >>
> >> Copy the character string.
> >>
> >> In a Cuis workspace print:
> >> str := String new writeStream.
> >> (32 to: 255) do: [ :n | str nextPut: n asCharacter]
> >> str contents.
> >>
> >> Code package and files allegedly for courier strike fonts are
> attached if
> >> you're
> >> interested.
> >>
> >>  - Dan
> >>
> >>
> >
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org



_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Hannes Hirzel
Then I would try to export the Squeak BitstreamVeraSansMono in
StrikeFont format and import into Cuis. That should work ...

On 7/25/15, Dan Norton <[hidden email]> wrote:

> Form class>>fromBinaryStream: has firstByte = 66, this is not an error but
> part of "BM" in the header of the .bmp file.
>
> The "Unsupported format..." error is caused by Cuis wanting biSize = 40 and
> ImageMagick
> putting a different value.
>
> Squeak has BitstreamVeraSansMono, a fixed-width font. Why couldn't  that be
> used to
> produce .bmp files instead of ImageMagick? The BM header would be compatible
> with Cuis
> AFAIKT and it might get us a fixed-width font on Cuis.
>
> On 25 Jul 2015 at 13:14, H. Hirzel wrote:
>
>> I did the StrikeFont exercises in Squeak. So it could be that
>> Squeak
>> has a BMP file reader which is no longer included in Cuis. A thing
>> to
>> check....
>>
>> --HH
>>
>> On 7/25/15, H. Hirzel <[hidden email]> wrote:
>> > I would try to save the *.bmp file as a *.gif file in Microsoft
>> Paint
>> > and then try to load it with
>> >
>> > ImageReadWriter class>>formFromStream:
>> >
>> > HTH
>> >
>> > --HH
>> >
>> > On 7/24/15, Dan Norton <[hidden email]> wrote:
>> >> On 20 Jul 2015 at 19:33, Juan Vuletich wrote:
>> >>
>> >>>
>> >>> Hi Dan,
>> >>>
>> >>> On 7/19/2015 10:13 PM, Dan Norton wrote:
>> >>>     On 19 Jul 2015 at 10:31, Juan Vuletich wrote:
>> >>>
>> >>>     > On 7/18/2015 3:37 PM, Dan Norton wrote:
>> >>>     > > On 11 Jul 2015 at 13:40, Juan Vuletich wrote:
>> >>>     > >
>> >>>     > >> Hi Folks,
>> >>>     > >>
>> >>>     > >> It is not too hard to build new StrikeFonts. You need
>> to
>> >>> build,
>> >>>     > by
>> >>>     > >> hand,
>> >>>     > >> files like the ones in here:
>> >>>     > >>
>> >>>     >
>> >>>
>> https://dl.dropboxusercontent.com/u/13285702/BitmapDejaVuAllSizes.zi
>> >>>     > >> p
>> >>>     > >> and learn a bit about stuff like #installDejaVu2 .
>> Maybe it
>> >>> was
>> >>>     > with
>> >>>     > >> this method and the files in this zip that built the
>> >>> existing
>> >>>     > >> instances
>> >>>     > >> of StrikeFont. Not sure.
>> >>>     > >>
>> >>>     > > That's intrigueing but I can't reproduce it. Maybe the
>> .bmp
>> >>> but
>> >>>     > where did you get the .txt?
>> >>>     > >
>> >>>     > >   - Dan
>> >>>     >
>> >>>     > I wrote them with a text editor. Check #installDejaVu2
>> and
>> >>> really
>> >>>     > try to
>> >>>     > understand how StrikeFonts work and how they are built
>> with
>> >>> this
>> >>>     > method.
>> >>>     > Maybe you'll become enlightened.
>> >>>     >
>> >>>
>> >>>     A StrikeFont consists of a characterToGlyphMap, xTable,
>> glyphs,
>> >>> name, and several
>> >>>     scalars. StrikeFont class methods create fonts by
>> processing
>> >>> file pairs assumed to be in the
>> >>>     "AAFonts" subdirectory. For example:
>> >>>
>> >>>     DejaVu Sans Oblique 14.bmp
>> >>>     DejaVu Sans Oblique 14.txt
>> >>>
>> >>>     Is one such pair providing the italic (oblique) style for
>> >>> 14-point size. There is a pair for every
>> >>>     font size and style: base, bold, italic, and bold italic.
>> >>> Therefore a font such as "DejaVu Sans"
>> >>>     which is available in the size interval 5 to 24 requires
>> 160
>> >>> files. The file names are stylized
>> >>>     and encoded in the StrikeFont class methods.
>> >>>
>> >>>     Glyphs come from the .bmp file. The .txt file is a string
>> of
>> >>> numbers; the first three specify
>> >>>     pointSize, ascent, and descent. The rest of the numbers in
>> the
>> >>> .txt file are used to form the
>> >>>     xTable, which is the index into the glyphs for a character.
>> The
>> >>> characterToGlyphMap is an
>> >>>     array of 256 entries which map a character's ascii value to
>> the
>> >>> xTable and thence to the
>> >>>     glyphs.
>> >>>
>> >>>     The bold, italic, and bold italic styles are stashed as
>> >>> derivatives of the base and not
>> >>>     selectable from the current menus.
>> >>>
>> >>>     StrikeFont is a subclass of AbstractFont, which has class
>> >>> variables AvailableFonts and
>> >>>     DefaultFont.
>> >>>
>> >>>     If it can't find a file, StrikeFont will loop.
>> >>>
>> >>> Great! You got it all.
>> >>>
>> >>>     In regard to creating the .bmp and .txt files, you say, "
>> I
>> >>> wrote them with a text editor."
>> >>>     Please tell me which text editor you used. None of mine do
>> >>> that.
>> >>>
>> >>> The bmp files can be created with screen capture program,
>> after
>> >>> entering suitable text in it. Maybe
>> >>> you need to stitch several pieces together, etc. WRT the txt
>> files,
>> >>> well, the editor didn't do it for
>> >>> me. I wrote them. I _typed_ them. Maybe I used some (long lost)
>> code
>> >>> to look for white columns
>> >>> separating glyphs, but I'm not really sure.
>> #xTallyPixelValue:orNot:
>> >>> and friends are great for this
>> >>> kind of stuff.
>> >>>
>> >>> In any case, it will be easier for you, as you want a
>> monospaced
>> >>> font. Printing something like (32
>> >>> to: 255) collect: [ :ascii | ascii-32 * 9 ] into the file might
>> be
>> >>> enough.
>> >>>
>> >>> You have all the pieces at hand. it just requires a bit of
>> >>> patience.
>> >>>
>> >>
>> >> Encouraged by this, I have tried cobbling a fixed-width
>> StrikeFont from
>> >> Courier New which
>> >> comes with Windows7. At this point, if some kind of fixed-width
>> smudges
>> >> would appear then
>> >> it would be progress. Here's where I am:
>> >>
>> >> The immediate problem is an error: 'Unsupported format. Try
>> >> "Graphics-Files-Additional.pck.st".' which arises when
>> ImageReadWriter
>> >> class>>formFromStream: examines the .bmp file.
>> >>
>> >> Higher in the context, Form class>>fromBinaryStream: has
>> firstByte = 66
>> >> which I mention
>> >> because of the way the .bmp file was made. Here is the process I
>> used,
>> >> from
>> >> the bottom up:
>> >>
>> >> ImageMagick freeware produces the glyphs but with something
>> stubbornly
>> >> prepended. The
>> >> command line is:
>> >> convert -font \windows\fonts\cour.ttf -pointsize 12
>> >> label:@characters.txt
>> >> courier12.bmp
>> >>
>> >> Using NotePad, save characters.txt with encoding: UTF-8.
>> >>
>> >> Paste the character string onto a NotePad
>> >>
>> >> Copy the character string.
>> >>
>> >> In a Cuis workspace print:
>> >> str := String new writeStream.
>> >> (32 to: 255) do: [ :n | str nextPut: n asCharacter]
>> >> str contents.
>> >>
>> >> Code package and files allegedly for courier strike fonts are
>> attached if
>> >> you're
>> >> interested.
>> >>
>> >>  - Dan
>> >>
>> >>
>> >
>>
>> _______________________________________________
>> Cuis mailing list
>> [hidden email]
>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>
>
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Dan Norton
On 25 Jul 2015 at 18:57, H. Hirzel wrote:

> Then I would try to export the Squeak BitstreamVeraSansMono in
> StrikeFont format and import into Cuis. That should work ...
>

Yes, but the problem is how to get BitstreamVeraSansMono into StrikeFont format.

In Squeak 4.6, the font of a character string in the transcript can be changed from the default
to one of the BitstreamVeraSansMono sizes: #(9 12 15 24 36). Digging down through the
Transcript submorphs I found aTextMorphForEditView. When this is sent
"exportAsBMPNamed: 'sansmono12.bmp'" for example, the image in the Transcript is placed
in the .bmp file.

This needs improvement. The good news is that the glyphs appear to be sized and shaped
based on the font. The bad news is that the .bmp file contains a multi-line image, exactly as it
appears in the transcript and the entire first line of this appears to result from the blank (ascii
32). The next line looks pretty good until it reaches the edge of the pane where it stops. The
following characters are on the next line, etc.

What's needed is a morph which will contain the entire character set 32 to 255 without
wrapping and with the desired font. That morph can be sent the #exportAsBMPNamed:
message and then maybe we can make a strikefont.

[ snip ]

 - Dan

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Juan Vuletich-4
In reply to this post by Dan Norton
Hi Dan,

The format saved by image writer is not (currently) supported in Cuis, Squeak, etc. Maybe there is a command line option to tell imageMagick to use a more standard bmp format. Or you can just save in png. I opened them in Windows Paint, clicked on 'save' and then Cuis was able to read them.

Your xTables in the txt files are indeed wrong. For Courier12, the width of the bmp file is around 1500 pixels. And in the xTable you have entries calling pixels around x=2600. Impossible. Take a look at the bmp you generated count the width used by each glyph. It is 7 pixels wide. Your xTable is multiples of 12...

After fixing this 2 issues, I run your stuff and indeed it starts to run. It looks like a bit more work is needed in the xTable, though.

Cheers,
Juan Vuletich

On 7/24/2015 5:20 PM, Dan Norton wrote:

Encouraged by this, I have tried cobbling a fixed-width StrikeFont from Courier New which comes with Windows7. At this point, if some kind of fixed-width smudges would appear then it would be progress. Here's where I am:

The immediate problem is an error: 'Unsupported format. Try "Graphics-Files-Additional.pck.st".' which arises when ImageReadWriter class>>formFromStream: examines the .bmp file.

Higher in the context, Form class>>fromBinaryStream: has firstByte = 66 which I mention because of the way the .bmp file was made. Here is the process I used, from the bottom up:

ImageMagick freeware produces the glyphs but with something stubbornly prepended. The command line is:
           convert -font \windows\fonts\cour.ttf -pointsize 12 [hidden email] courier12.bmp

Using NotePad, save characters.txt with encoding: UTF-8.

Paste the character string onto a NotePad

Copy the character string.

In a Cuis workspace print:
           str := String new writeStream.
           (32 to: 255) do: [ :n | str nextPut: n asCharacter]
           str contents.

Code package and files allegedly for courier strike fonts are attached if you're interested.

 - Dan


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Dan Norton
In reply to this post by Dan Norton
Attached is a StrikeFont of Courier New 12. It's hacked - not polished by any means. It was
made by:

Making "characters.txt" by printing in a Cuis workspace, copying to Notepad, and saving with
encoding: ANSI.

This was input to ImageMagick to make a .png file.

The .png file was opened in Paint, then saved as a .bmp file.

The body of the .txt file was generated by:
(32 to: 257) collect: [ :ascii | ascii-32 * 7 ]  "note the 257 - needed to avoid index out of range"

The first three numbers in .txt were finagled to 12 15 5 (the last two anyway).

The font was installed by running:
StrikeFont installCourier.  "code in Courier.pck.st "

Text in the Text Editor pane was highlighted and the font changed to Courier 12 point. It
looked much too small. Going back to Paint, the glyphs were selected and stretched
vertically. The font was re-installed. The vertical distortion is probably obvious.

At least it's recognizable as Courier and it's fixed width. Files are attached.

 - Dan

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org

CourierExample2.zip (14K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Dan Norton
In reply to this post by Dan Norton
When the glyphs for the Cuis default font (DejaVu) or those for DejaVu Sans are filed out and
then examined using Paint, it is obvious that they are of much higher quality than those
produced by ImageMagick. The height is exactly right, as can be seen at ascii 129, 132, and
133. They are the right size and crisp when displayed. This is the quality we should have for a
fixed-width font. How were these .bmp files produced?

On 25 Jul 2015 at 21:41, Dan Norton wrote:

> Attached is a StrikeFont of Courier New 12. It's hacked - not
> polished by any means. It was
> made by:
>
> Making "characters.txt" by printing in a Cuis workspace, copying to
> Notepad, and saving with
> encoding: ANSI.
>
> This was input to ImageMagick to make a .png file.
>
> The .png file was opened in Paint, then saved as a .bmp file.
>
> The body of the .txt file was generated by:
> (32 to: 257) collect: [ :ascii | ascii-32 * 7 ]  "note the 257 -
> needed to avoid index out of range"
>
> The first three numbers in .txt were finagled to 12 15 5 (the last
> two anyway).
>
> The font was installed by running:
> StrikeFont installCourier.  "code in Courier.pck.st "
>
> Text in the Text Editor pane was highlighted and the font changed to
> Courier 12 point. It
> looked much too small. Going back to Paint, the glyphs were selected
> and stretched
> vertically. The font was re-installed. The vertical distortion is
> probably obvious.
>
> At least it's recognizable as Courier and it's fixed width. Files
> are attached.
>
>  - Dan
>
> Attachments:
>   C:\Cuis\CourierExample2.zip



_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-Width Font

Hannes Hirzel
Juan produced the fonts. There is some discussion about it in the
mailing list archive.

--HH

On 7/28/15, Dan Norton <[hidden email]> wrote:

> When the glyphs for the Cuis default font (DejaVu) or those for DejaVu Sans
> are filed out and
> then examined using Paint, it is obvious that they are of much higher
> quality than those
> produced by ImageMagick. The height is exactly right, as can be seen at
> ascii 129, 132, and
> 133. They are the right size and crisp when displayed. This is the quality
> we should have for a
> fixed-width font. How were these .bmp files produced?
>
> On 25 Jul 2015 at 21:41, Dan Norton wrote:
>
>> Attached is a StrikeFont of Courier New 12. It's hacked - not
>> polished by any means. It was
>> made by:
>>
>> Making "characters.txt" by printing in a Cuis workspace, copying to
>> Notepad, and saving with
>> encoding: ANSI.
>>
>> This was input to ImageMagick to make a .png file.
>>
>> The .png file was opened in Paint, then saved as a .bmp file.
>>
>> The body of the .txt file was generated by:
>> (32 to: 257) collect: [ :ascii | ascii-32 * 7 ]  "note the 257 -
>> needed to avoid index out of range"
>>
>> The first three numbers in .txt were finagled to 12 15 5 (the last
>> two anyway).
>>
>> The font was installed by running:
>> StrikeFont installCourier.  "code in Courier.pck.st "
>>
>> Text in the Text Editor pane was highlighted and the font changed to
>> Courier 12 point. It
>> looked much too small. Going back to Paint, the glyphs were selected
>> and stretched
>> vertically. The font was re-installed. The vertical distortion is
>> probably obvious.
>>
>> At least it's recognizable as Courier and it's fixed width. Files
>> are attached.
>>
>>  - Dan
>>
>> Attachments:
>>   C:\Cuis\CourierExample2.zip
>
>
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
123