BBC BASIC
« Program editor font selection »

Welcome Guest. Please Login or Register.
Apr 28th, 2017, 9:38pm


Cross-platform BBC BASIC (Win32, Linux x86, Android, Mac OS-X, Raspberry Pi)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Program editor font selection  (Read 240 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 437
xx Program editor font selection
« Thread started on: Sep 26th, 2016, 09:47am »

The BBC BASIC for Windows IDE allows you to select only monospaced (fixed pitch) fonts for the editor pane. The reason for that restriction is that early versions of the editor used a very simple calculation to convert between the caret position in pixels and the character to which it points (basically simply dividing or multiplying by the character width).

Whilst the restriction remains, the reason for it doesn't. When BB4W was upgraded to support Unicode and bidirectional text clearly it could no longer assume that all characters are the same width. For example even in a notional 'monospaced' font Chinese characters are inevitably going to be wider than most of the others. Things get even more complicated with right-to-left-written languages such as Hebrew or Arabic, when an increasing character index corresponds to a decreasing pixel value!

One disadvantage of the restriction is that not all 'monospaced' TrueType fonts are actually flagged as such in the TTF file, which can mean that a font which ought to be perfectly suitable isn't available for selection. A specific example is the Fixedsys Excelsior font which is an unofficial Unicode extension of FixedSys; as such it would potentially be very suitable for use in BB4W but it isn't listed in the Set Font dialog.

Neither LB Booster nor BBCSDL impose the same restriction and you can select any font for the editor pane (although the BBCSDL editor cannot handle bi-directional text). My question therefore is: should I remove the restriction in a possible future release of BB4W? Would it be better to allow any font to be selected?

Richard.

User IP Logged

DDRM
Global Moderator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 10
xx Re: Program editor font selection
« Reply #1 on: Sep 26th, 2016, 2:12pm »

Hi Richard,

If it gives added flexibility at little or no functional cost, it seems an easy decision to say "go for it"!

Best wishes,

D
User IP Logged

michaelgallup
Guest
xx Re: Program editor font selection
« Reply #2 on: Sep 28th, 2016, 02:10am »

For quite some time I have been curious about text and its creation.
I believe there are 255 ASCII characters..
I had the impression that they could be modified somehow because after all, there are many languages.

Fonts would be just another design for text.

Being able to modify text design, including the color within a character could be very useful. Especially in games.

Designing text sized characters wouldn't be especially hard for graphics, but real modified text characters would be cool.

I have seen some text games in the tutorial.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 437
xx Re: Program editor font selection
« Reply #3 on: Sep 28th, 2016, 08:32am »

on Sep 28th, 2016, 02:10am, michael wrote:
I believe there are 255 ASCII characters.

No, ASCII is a 7-bit code. There are 128 possible values, 0 to 127 inclusive, although only 95 (codes 32 to 126 inclusive) are 'printing' characters - which includes space. Sometimes a parity bit (odd or even parity) is added to make 8 bits.

ANSI (ISO-8859) is an 8-bit code; it has 191 'printing' characters: codes 32 to 126 and 160 to 255 inclusive. ANSI and other 8-bit codes are best avoided these days because of the complication and messiness of Code Pages.

Unicode is a 20-bit code (roughly) but both BB4W and BBCSDL support only the 16-bit subset known as the Basic Multilingual Plane (BMP).

Richard.
« Last Edit: Sep 28th, 2016, 08:35am by Richard Russell » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls