AminetAminet
Search:
82744 packages online
About
Recent
Browse
Search
Upload
Setup
Services

dev/src/BulletExamples.lha

Mirror:Random
Showing:m68k-amigaosgeneric
No screenshot available
Short:Example code for using outline fonts
Author:matsp888 at yahoo.com (Mats Peterson)
Uploader:matsp888 yahoo com (Mats Peterson)
Type:dev/src
Version:1.11
Replaces:dev/src/BulletExamples.lha
Architecture:m68k-amigaos >= 2.0.4
Distribution:Aminet
Date:2019-06-21
Download:http://aminet.net/dev/src/BulletExamples.lha - View contents
Readme:http://aminet.net/dev/src/BulletExamples.readme
Downloads:319
Here's some interesting example code dealing with Compugraphic outline
fonts and the Bullet font scaling engine from the 1992 Amiga Mail Vol. 2
article collection. I have modified the code to compile cleanly with
SAS/C 6.58 and to use pragmas and direct library calls rather than
calling the stub routines in amiga.lib.

I have modified the programs to open a new screen. The viewport modes,
bit depth, and background and foreground colors can be set with the
`V=VPModeID', `B=BitDepth' and `C=Colors' command line keywords. The
`V=VPModeID' keyword expects a hexadecimal value. I have included a
small utility called `ListVPModes' that displays a list of available
viewport modes that have a name, and their IDs. The `C=Colors' keyword
expects a six character long hexadecimal value that defines the
background and foreground color RGB triplets. For example, `fff000' sets
a white background and black foreground. The default viewport modes, bit
depth and colors are taken from the Workbench screen.

I have improved `View' somewhat:

- The program supports UCS-2 and UCS-4 encoded text files (use the U=UCS
  command line keyword with 2 or 4 as the value). The Bullet font
  scaling engine is limited to 16-bit code points, though.
- The leading (distance between baselines) can be set in percent of the
  point size (default 120).
- The descender (the portion of a glyph that extends below the baseline)
  can be set in percent of the point size (default 25). I wish there would
  be a way to calculate the descender automatically, but that seems to
  take using diskfont.library and OpenDiskFont(). I have made the
  `ViewDiskfont' program mentioned below display some data about the font,
  among them the descender percentage.
- Kerning can optionally be disabled with the N=NoKern command line
  switch.
- Due to problems with the kerning of whitespace, it has been disabled by
  default. Not using whitespace kerning is not uncommon, though. Most
  programs I've seen, both on the Amiga platform and otherwise, don't use
  it. It can be enabled with the `S=SpcKern' command line switch if
  desired.
- Tabular (non-proportional) figures can optionally be enabled with the
  `T=TabFigs' command line switch.
- Whitespace characters are handled properly.
- The text scrolls up when it reaches the bottom of the window, rather
  than the whole window being cleared.
- The output of the text can be paused/resumed with the Space key, or
  ended with the `q' key.
- The program waits for the user to click the close gadget rather than
  closing the window immediately at the end of the displayed file.

I have added a small program called `ViewChars', that lets you view a
range of Unicode characters. The `StartCode' and `EndCode' command line
arguments are expected to be hexadecimal values. Characters with no
glyph and no width are represented by a white square (U+25A1). The
default range is from U+0021 to U+007E inclusive. For relatively logical
reasons this program doesn't make use of any kerning information.

Outline fonts are supported by diskfont.library in AmigaOS 2.04 (V37)
and up, unfortunately the Text() function doesn't seem to make use of
any kerning information in the font, so if kerning adjustment is desired
it will be necessary to use the Bullet engine directly, and blit to the
raster ourselves, which is also done in the example programs. I have
included an additional program called `ViewDiskfont' that displays a
text string with a chosen font using diskfont.library and the Text()
function for demonstrational purposes. Please note that if you change
the XDPI or YDPI command line argument between invocations, it will be
necessary to use `avail flush' in order to clear any previously
generated font bitmaps from memory.


New in v1.11
------------
    - In `View', added a `T=TabFigs' command line switch to enable
      tabular (non-proportional) figures.

New in v1.10
------------
    - Due to more problems with the kerning of whitespace than just the
      figure `1' case mentioned below, I've decided to disable it
      altogether by default. Not using whitespace kerning is not
      uncommon, though. Most programs I've seen, both on the Amiga
      platform and otherwise, don't use it. It can be enabled with the
      `S=SpcKern' command line switch if desired.
    - The `O=OneKern' switch has been removed.

New in v1.9
-----------
    - In the `View' program, kerning between the figure `1' and
      whitespace is now disabled by default, since it's rather wonky
      with several fonts for some reason. This kerning can be enabled
      with the `O=OneKern' command line switch. As an example of the
      bad kerning, run `View' with the sample file `Text/BadKern'
      using the `O=OneKern' switch.

New in v1.8
-----------
    - In `View.c', simplified the code for processing UCS-2 and UCS-4
      encoded text.
    - In 'View.c' and 'ViewChars.c', ScrollRaster() is now used to
      scroll the text in the window up, rather than using RectFill() to
      clear the whole window.
    - In `View.c' and `ViewChars.c', the output of the text can be
      paused/resumed with the Space key, or ended with the 'q' key.
    - New file `input.c' that handles IDCMP input.

New in v1.7
-----------
    - Corrected a typo in README; the default code point range in
      `ViewChars' begins at U+0021, not U+0020.
    - Moved the opening of the screen and the window to `window.c'.
    - The programs now make the newly opened screen use the video modes
      of the Workbench screen by default, rather than blindly assuming
      HiRes (640 horizontal pixels).
    - New command line keywords `V=VPModeID', `B=BitDepth' and
      `C=Colors'.
    - A small utility called `ListVPModes' has been included that lists
      available viewport modes that have a name, and their IDs.
    - The `I=Interlace' command line switch has been removed.
    - In `View' and `ViewChars' the descender (the portion of a glyph
      that extends below the baseline) can now be set. I wish there
      would be a way to calculate the descender automatically, but that
      seems to take using diskfont.library and OpenDiskFont(). I have
      made the `ViewDiskfont' program display some data about the font,
      among them the descender percentage.
    - In View.c and ViewChars.c, RectFill() painted over the borders.
      Fixed.
    - Moved the BumpRev revision files to `src/rev'.

New in v1.6
-----------
    - In `ViewChars', the `StartCode' and `EndCode' command line
      arguments are now expected to be hexadecimal values. It's more
      natural to use hexadecimal when dealing with Unicode code points
      after all.

New in v1.5
-----------
    - The sample text files `SampleTextUCS2' and `SampleTextUCS4' in the
      `Text' subdirectory stated that the ff, fi, fl and ffl ligatures
      are located in the Arabic Presentation Forms-A Unicode block. We
      need to get historical here. The Bullet engine was written at a
      time when the Unicode standard was at version 1.0, and these
      ligatures are in fact located in the Unicode 1.0 Private Use Area
      (U+E800-U+FDFF).

New in v1.4
-----------
    - Moved the source code to a `src' subdirectory.
    - Added a command line argument to `View' to set the leading
      (distance between baselines) in percent of the point size (default
      120).
    - `View' now supports UCS-2 and UCS-4 encoded text files.
    - Added a small program called `ViewChars' that lets you view a
      range of Unicode characters.
    - The programs can now be run from Workbench, although you won't be
      able to provide any command line arguments. The default text file
      for `View' is `Text/SampleText'.
    - Now letting the menu bar be visible when opening the window of a
      program.
    - Corrected a statement concerning `ViewDiskfont' in README
      regarding the need to use `avail flush' when changing the command
      line arguments. It only concerns the XDPI and YDPI values.
    - Moved the sample text files to a `Text' subdirectory.
    - Added icons to various files.

New in v1.3
-----------
    - Now using BumpRev to manage revisions. This should have been done
      earlier.
    - Added a note in README about diskfont.library and the Text()
      function seemingly not supporting any kerning information in the
      font. Also included an additional program called `ViewDiskfont'
      that displays a text string with a chosen font using
      diskfont.library and the Text() function for demonstrational
      purposes.

New in v1.2
-----------
    - The programs now open a new screen.
    - New command line switches: `N=NoKern' disables kerning (only
      applicable to `View'), and `I=Interlace' sets interlaced video.
    - The opened window is now made active by using the WA_Activate tag
      in OpenWindowTags() in BulletMain.c and BulletMainFile.c.
    - In View.c, RectFill() didn't fill the whole window. Fixed.
    - In View.c, obtain the width of whitespace characters with
      ObtainInfo() and the OT_WidthList tag, rather than just using 1/4
      em as the width. Also adjust the kerning of whitespace.


Contents of dev/src/BulletExamples.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                  271     632  42.9% -lh5- 135d May 25 08:34 BulletExamples.info
[generic]                10033   29043  34.5% -lh5- d342 Aug 18  1992 BulletExamples/Bullet.txt
[generic]                  216     463  46.7% -lh5- cc0e Jun  1 07:00 BulletExamples/Bullet.txt.info
[generic]                 2193    5217  42.0% -lh5- 8ee5 Jun 22 04:32 BulletExamples/Changes
[generic]                  216     463  46.7% -lh5- cc0e Jun  1 07:01 BulletExamples/Changes.info
[generic]                  370     484  76.4% -lh5- 99c6 Jun  8 07:35 BulletExamples/ListVPModes
[generic]                  272     632  43.0% -lh5- c014 Jun  1 07:27 BulletExamples/Original.info
[generic]                 2815    9121  30.9% -lh5- 15a8 Dec 18  1992 BulletExamples/Original/BulletMain.c
[generic]                 2773    8856  31.3% -lh5- a83c Dec 18  1992 BulletExamples/Original/BulletMainFile.c
[generic]                 1782    5685  31.3% -lh5- a58f Dec 18  1992 BulletExamples/Original/engine.c
[generic]                 5047    8964  56.3% -lh5- 5eee Nov 12  1992 BulletExamples/Original/Rotate
[generic]                 3107    9676  32.1% -lh5- 1b8d Dec 18  1992 BulletExamples/Original/Rotate.c
[generic]                 4389    7776  56.4% -lh5- 6b40 Nov 12  1992 BulletExamples/Original/View
[generic]                 3070    9799  31.3% -lh5- 6c7f Dec 18  1992 BulletExamples/Original/View.c
[generic]                 2069    4453  46.5% -lh5- bb93 Jun 22 04:29 BulletExamples/README
[generic]                  216     463  46.7% -lh5- cc0e Jun  1 07:01 BulletExamples/README.info
[generic]                 3080    5204  59.2% -lh5- fbd6 Jun 22 04:40 BulletExamples/Rotate
[generic]                  390     835  46.7% -lh5- bcdb Jun  1 07:29 BulletExamples/Rotate.info
[generic]                 2669    8238  32.4% -lh5- 8d3f Jun  9 04:10 BulletExamples/src/BulletMain.c
[generic]                 2840    9040  31.4% -lh5- 5651 Jun  9 04:10 BulletExamples/src/BulletMainChars.c
[generic]                 2951    9260  31.9% -lh5- 4e2d Jun 22 04:24 BulletExamples/src/BulletMainFile.c
[generic]                 1713    5450  31.4% -lh5- 2dde May 25 08:36 BulletExamples/src/engine.c
[generic]                  411    1085  37.9% -lh5- ca0f Jun 14 09:32 BulletExamples/src/input.c
[generic]                  112     168  66.7% -lh5- 000e Jun 12 22:39 BulletExamples/src/input.h
[generic]                  373    1039  35.9% -lh5- 8471 Jun 12 22:35 BulletExamples/src/makefile
[generic]                  135     209  64.6% -lh5- ea2a May 25 08:34 BulletExamples/src/mystartup/makefile
[generic]                  350     756  46.3% -lh5- 2ac8 May 25 08:34 BulletExamples/src/mystartup/mystartup.c
[generic]                  154     226  68.1% -lh5- a155 May 25 08:34 BulletExamples/src/mystartup/mystartup.h
[generic]                   79     121  65.3% -lh5- d6c0 Jun  4 06:45 BulletExamples/src/rev/bumprev
[generic]                  109     191  57.1% -lh5- 2573 Jun 22 04:39 BulletExamples/src/rev/Rotate_rev.h
[generic]                    3       3 100.0% -lh0- 58c4 Jun 22 04:39 BulletExamples/src/rev/Rotate_rev.rev
[generic]                  109     185  58.9% -lh5- 27cc Jun 22 04:39 BulletExamples/src/rev/View_rev.h
[generic]                    3       3 100.0% -lh0- 58c4 Jun 22 04:39 BulletExamples/src/rev/View_rev.rev
[generic]                  117     200  58.5% -lh5- 2913 Jun 22 04:39 BulletExamples/src/rev/ViewChars_rev.h
[generic]                    3       3 100.0% -lh0- 58c4 Jun 22 04:39 BulletExamples/src/rev/ViewChars_rev.rev
[generic]                  117     209  56.0% -lh5- 4ac5 Jun 22 04:39 BulletExamples/src/rev/ViewDiskfont_rev.h
[generic]                    3       3 100.0% -lh0- 58c4 Jun 22 04:39 BulletExamples/src/rev/ViewDiskfont_rev.rev
[generic]                 2995    9115  32.9% -lh5- da3a Jun  9 04:16 BulletExamples/src/Rotate.c
[generic]                 3577   11957  29.9% -lh5- 06c4 Jun 22 04:24 BulletExamples/src/View.c
[generic]                 2638    7684  34.3% -lh5- 36ac Jun 13 02:17 BulletExamples/src/ViewChars.c
[generic]                 1832    5496  33.3% -lh5- f523 Jun  9 04:16 BulletExamples/src/ViewDiskfont.c
[generic]                  822    2382  34.5% -lh5- 85a0 Jun  7 12:12 BulletExamples/src/window.c
[generic]                  128     177  72.3% -lh5- 5208 Jun  7 08:57 BulletExamples/src/window.h
[generic]                  272     632  43.0% -lh5- c014 Jun  4 07:14 BulletExamples/Text.info
[generic]                   38      63  60.3% -lh5- ba51 Jun 16 08:04 BulletExamples/Text/BadKern
[generic]                  216     463  46.7% -lh5- cc0e Jun 16 05:49 BulletExamples/Text/BadKern.info
[generic]                   50      60  83.3% -lh5- 40d8 May 30 13:21 BulletExamples/Text/KernTest
[generic]                  216     463  46.7% -lh5- cc0e Jun  4 07:17 BulletExamples/Text/KernTest.info
[generic]                   45      45 100.0% -lh0- d6c5 May 28 08:16 BulletExamples/Text/SampleText
[generic]                  216     463  46.7% -lh5- cc0e Jun  4 07:17 BulletExamples/Text/SampleText.info
[generic]                  247     496  49.8% -lh5- 0547 Jun  5 12:07 BulletExamples/Text/SampleTextUCS2
[generic]                  216     463  46.7% -lh5- cc0e Jun  4 07:17 BulletExamples/Text/SampleTextUCS2.info
[generic]                  282     992  28.4% -lh5- a655 Jun  5 12:07 BulletExamples/Text/SampleTextUCS4
[generic]                  216     463  46.7% -lh5- cc0e Jun  4 07:17 BulletExamples/Text/SampleTextUCS4.info
[generic]                 3226    5672  56.9% -lh5- 836c Jun 22 04:40 BulletExamples/View
[generic]                  391     835  46.8% -lh5- f5b6 Jun  1 07:29 BulletExamples/View.info
[generic]                 2874    4924  58.4% -lh5- 8ead Jun 22 04:40 BulletExamples/ViewChars
[generic]                  393     835  47.1% -lh5- 8ac3 Jun  3 03:48 BulletExamples/ViewChars.info
[generic]                 1732    2632  65.8% -lh5- 9bb9 Jun 22 04:40 BulletExamples/ViewDiskfont
[generic]                  393     835  47.1% -lh5- 8848 Jun  1 07:29 BulletExamples/ViewDiskfont.info
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total        60 files   77575  201302  38.5%            Jun 21 20:27

Aminet © 1992-2019 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>