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

dev/src/BulletExamples.lha

Mirror:Random
Showing:m68k-amigaosppc-amigaosppc-morphosi386-arosi386-amithlonppc-warpupppc-powerupgeneric
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.15
Replaces:dev/src/BulletExamples.lha
Architecture:m68k-amigaos >= 2.0.4
Distribution:Aminet
Date:2019-07-09
Download:http://aminet.net/dev/src/BulletExamples.lha - View contents
Readme:http://aminet.net/dev/src/BulletExamples.readme
Downloads:4220

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 point size is interpreted as centipoints. So, to set e.g. 14.75
  points, enter 1475.
- 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.
- Kerning of whitespace can optionally be enabled with the `S=SpcKern'
  command line switch. It's not widely used, however, and it might look
  cramped at times.
- Tabular (non-proportional) figures can optionally be enabled with the
  `T=TabFigs' command line switch.
- The tracking (letter-spacing) can be adjusted with the `R=Tracking'
  command line keyword. The value is percent of the point size, either
  positive or negative.
- 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.

The statement about the point size being interpreted as centipoints goes
for `ViewChars' and `Rotate' as well.

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.15
------------
    - In `View', whitespace kerning is now once again disabled by
      default. It's not widely used, and it might look somewhat cramped
      at times. Reintroduced the `S=SpcKern' command line switch, which
      now enables whitespace kerning in general.
    - In `View.c', removed the SPCKERN preprocessor macro.

New in v1.14
------------
    - In `View', the "diagnostic" `S=SpcKern' command line switch has
      been removed.
    - In `View.c', added a SPCKERN preprocessor macro that replaces the
      command line switch mentioned above. Also renamed the DEBUG
      preprocessor macro to DISPKERN.

New in v1.13
------------
    - In `View', whitespace kerning is now re-enabled, but only when the
      second character in a kerning pair is a non-whitespace character.
      The main issue in the past was that sometimes (such as with the
      figure `1') extra kerning was added to a glyph when whitespace was
      the second character in a pair, and this kerning value would also
      propagate to each succeeding whitespace character. The `S=SpcKern'
      switch now merely acts as a diagnostic feature to show the
      incorrect whitespace kerning in these isolated cases.

New in v1.12
------------
    - The point size for `View', `ViewChars' and `Rotate' is now
      interpreted as centipoints. So, to set e.g. 14.75 points, enter
      1475.
    - In `View', the tracking (letter-spacing) can now be adjusted with
      the `R=Tracking' command line keyword. The value is percent of the
      point size, either positive or negative.
    - In `View.c', checking for a NULL string pointer was not done
      before calling StrToLong(). Fixed.

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]                 2754    6885  40.0% -lh5- d91c Jul  9 03:37 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]                 2162    4690  46.1% -lh5- 99e4 Jul  9 03:22 BulletExamples/README
[generic]                  216     463  46.7% -lh5- cc0e Jun  1 07:01 BulletExamples/README.info
[generic]                 3101    5236  59.2% -lh5- 05b6 Jul  9 03:28 BulletExamples/Rotate
[generic]                  390     835  46.7% -lh5- bcdb Jun  1 07:29 BulletExamples/Rotate.info
[generic]                 2669    8234  32.4% -lh5- a9bb Jun 25 06:34 BulletExamples/src/BulletMain.c
[generic]                 2841    9042  31.4% -lh5- 9de7 Jun 25 06:36 BulletExamples/src/BulletMainChars.c
[generic]                 2977    9366  31.8% -lh5- a03f Jul  9 03:08 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]                  110     188  58.5% -lh5- d94e Jul  9 03:27 BulletExamples/src/rev/Rotate_rev.h
[generic]                    3       3 100.0% -lh0- 98c6 Jul  9 03:27 BulletExamples/src/rev/Rotate_rev.rev
[generic]                  108     182  59.3% -lh5- 48c4 Jul  9 03:27 BulletExamples/src/rev/View_rev.h
[generic]                    3       3 100.0% -lh0- 98c6 Jul  9 03:27 BulletExamples/src/rev/View_rev.rev
[generic]                  115     197  58.4% -lh5- 537a Jul  9 03:27 BulletExamples/src/rev/ViewChars_rev.h
[generic]                    3       3 100.0% -lh0- 98c6 Jul  9 03:27 BulletExamples/src/rev/ViewChars_rev.rev
[generic]                  117     206  56.8% -lh5- 2904 Jul  9 03:27 BulletExamples/src/rev/ViewDiskfont_rev.h
[generic]                    3       3 100.0% -lh0- 98c6 Jul  9 03:27 BulletExamples/src/rev/ViewDiskfont_rev.rev
[generic]                 3008    9146  32.9% -lh5- afca Jun 25 06:34 BulletExamples/src/Rotate.c
[generic]                 3650   12247  29.8% -lh5- dc19 Jul  9 03:16 BulletExamples/src/View.c
[generic]                 2648    7725  34.3% -lh5- 7dfb Jun 25 06:48 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]                   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]                 3270    5772  56.7% -lh5- e9b9 Jul  9 03:27 BulletExamples/View
[generic]                  391     835  46.8% -lh5- f5b6 Jun  1 07:29 BulletExamples/View.info
[generic]                 2880    4932  58.4% -lh5- b3af Jul  9 03:27 BulletExamples/ViewChars
[generic]                  393     835  47.1% -lh5- 8ac3 Jun  3 03:48 BulletExamples/ViewChars.info
[generic]                 1734    2628  66.0% -lh5- 0e50 Jul  9 03:28 BulletExamples/ViewDiskfont
[generic]                  393     835  47.1% -lh5- 8848 Jun  1 07:29 BulletExamples/ViewDiskfont.info
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total        58 files   78169  203271  38.5%            Jul  9 18:43

Page generated in 0.02 seconds
Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>