|
6. AWeb Enhancement |
|||||||||||||
|
Automagic Webfont ConfigurationBefore proceeding to the configuration of webfonts in AWeb, you need that both TrueType webfonts and AWeb are correctly installed and working on your Pegasos. The installation of TrueType fonts on the Pegasos/MorphOS platform was extensively described in a previous section. The installation of AWeb, instead, was not a simple task as one may think, in fact until some time ago there were some issues that often caused problems to unskilled users. The first problem was due to the fact that, among the MorphOS-native versions of AWeb, only a very old version [namely AWeb-II 3.4APL (8-Jun-2002)] and the latest versions [since AWeb APL Lite 3.5.06 beta (Jul 21 2005)] ran without issues on the Pegasos, while many difficulties of different kinds prevented that the intermediate versions ran flawlessly. [Anyway, in the meanwhile, all 68k versions of AWeb always ran without problems by means of Trance (MorphOS 68k JIT-emulator)]. The second problem for AWeb users is that the GUI of AWeb is a ClassAct/Reaction program, that needs the relevant classes, images and gadgets of either one of these software packages. I strongly suggest that, rather than ripping and installing Reaction components from your old AmigaOS 3.5/3.9, you instead download their previous version, ClassAct. In fact, some Reaction components are not fully compatible with MorphOS, while ClassAct, being an AmigaOS 3.1 product, is fully compatible. You can download a ClassAct package from Aminet or its latest version from Amitrix homepage. Thanks to the work of Gunnar BigGun von Boehn, now it is possible to avoid any issue. You should download his new AWeb MAX distribution archives available here, that already contain any component needed by AWeb (in particular ClassAct). You should simply extract the archive contents, and AWeb will run directly out of the box.
Anyway, you could find convenient to install even the components of
ClassAct
version 3.3 in SYS:, because in such a way they will be available for
any other program that requires ClassAct/Reaction elements. If you
search for ClassAct in the HTML file of Amitrix homepage (Amitrix was the
distributor of the old commercial version of AWeb), you will also
find the installation instructions. Please note that, if you are running AWeb MAX just after extraction form its archive, you should should open soon the "Settings" menu and select "Save current settings". This actually creates in ENV: and ENVARC: the file AWeb3/browser, whose existence is absolutely essential in the following operations. So, from now on, I assume that the two mandatory ingredients of our recipe, TrueType webfonts and AWeb, are correctly installed and working on your Pegasos. If this is not true, the following procedures in this section will not work! So, if you need to make sure, check first your installations. Run a wordprocessor or a MUI application and try to use your TrueType fonts in it. Go online and display a few sites with AWeb and its native fonts. Is everything OK? If your answer is yes, you can go ahead.
Ehm... You also need ARexx working! If you
have not yet activated ARexx in your MorphOS environment, please do the
following.
The next step is extremely simple: you must run WebfontSetter.awebrx. This program modifies the files ENV:AWeb3/browser (i.e RAM:Env/AWeb3/browser, the volatile preference storage for AWeb fonts) and ENVARC:AWeb3/browser (i.e. SYS:Prefs/Env-Archive/AWeb3/browser, the permanent preference storage for AWeb fonts, located on your hard disk). The changes overwrite only your previous font preferences and do not affect any other AWeb setting present in the browser configuration file. Furthermore, you should not fear because a backup copy of your old AWeb font preferences is automatically created. Therefore you can easily restore the original preferences later, just in case you do not like the changes. So be trustful, open a shell window in the directory where you put WebfontSetter.awebrx (in this example it is in the Ram Disk), type the white part of the following line:
The following actions are done. First, for your convenience and security, WebfontSetter.awebrx renames ENVARC:AWeb3/browser to ENVARC:AWeb3/browser_backup_file. This preserves your original preference file. Then the program reads the current configuration file ENV:AWeb3/browser, erases all the font-related lines contained therein, inserts new webfont defaults, and saves the file back to ENV:AWeb3/ and ENVARC:AWeb3/. The changes are immediately effective: AWeb already uses webfonts! Anyway, remember that the FreeType2 engine must render the new fonts, so you may observe a delay before font refresh actually happens. Now go to some well-known website, and check that its text is displayed with a new aspect. Or else load the webfont test file and observe the result. Compare with this image of Firefox that displays the same file with equivalent font sizes. (Further customisation/optimisation can be done by means of the ARexx plugin described in the following subsection). The changes done in the browser configuration file should be fool-proof. All the fonts mentioned in the Webfonts subsection were set, as well as standard traps like those mentioned in the Minimal Font Optimisation subsection. If some webfonts are not present in your system, this is not a problem, because the default fonts will be used instead. You can install the missing TrueType fonts in your OS any time later, and soon AWeb will start using them automatically. However, you are advised that the presence of at least the three default TrueType webfonts (Arial, Times New Roman, and Courier New) is mandatory!
At any time, at this stage or even after the
actions described in the following subsection, you can fully restore your
previous AWeb font configuration. It is sufficient to do the
following actions:
Webfont PluginSoon after you have configured AWeb for the use of webfonts by means of WebfontSetter.awebrx, the aspect of the fonts displayed by the browser should be almost equal to that provided by Firefox. This is true if the resolution of your AWeb screen is 1280x1024, but, if you use another screen resolution, it is probable that font sizes are not yet as you like. You will be able to make all the necessary customisations (and much more) in real time with a few mouse clicks as soon as you install my AWeb plugin, WebfontManager.awebrx. The installation must be done in two phases. First you need to copy the WebfontManager.awebrx file in the Plugins directory of AWeb. If this directory still does not exist, you can create it with the shell command:
![]() Press "Add" to create a new button, and insert the relevant text in the label and command textfields; repeat six times. The picture shows the result after the definition of all the six buttons, so you can read there the labels and commands that should be inserted each time. Labels are in the first column, commands with arguments in the second column. When you have finished, click on "1 Options" and activate the "Show user buttons" gadget, then press "Save". The new buttons should appear in the header strip of AWeb. You are now ready for a first test of the dynamic font size management offered by WebfontManager.awebrx. Press the "Reduce" button, expect that font refresh occurs, and observe the result; if you repeat this operation 8 times, you will reach the smallest set of fonts. You may return instantaneously to the original font sizes by pressing the "MidFonts" button. Now press the "Enlarge" button, expect that font refresh occurs, and observe the result; if you repeat this operation 16 times, you will reach the biggest set of fonts. Now you can go instantaneously up and down along the scale of available sizes with the "Reduce" and "Enlarge" buttons, or directly to the center and the extremes with the "MidFonts", TinyFonts", and "HugeFonts" buttons. The time needed for these operations depends on various factors: (1) the speed of your Pegasos, (2) your screen resolution, (3) the processing time of WebfontManager.awebrx, (4) the number of webfonts displayed in the HTML page, (5) the rendering time per font, (6) the size of the fonts rendered, and (7) other secondary factors. On a PegasosII G4 (2) is almost irrelevant, and (3) is very short, so the most important factors are (4), (5), and (6). Assuming you are displaying this HTML page, where only two webfonts are used ("Verdana" and "Courier New"), you will see the font refresh after 1 or 2 seconds when reducing the original sizes, and after 2 or 3 seconds when enlarging the original sizes. Thus the average time needed for refresh of a single webfont is about 1 second for the largest sizes, and reduces to about 1/2 second for the smallest sizes. Once the fonts are rendered and are available in RAM, any subsequent recall is very fast because the delay (5) goes to zero and (4) and (6) become irrelevant. Now you can try a more complete and explicit experiment. Press this link: it will load the webfont test file in a new window. Within this window you will be able to view the 7 HTML sizes of all the webfonts at once. So, when you will play with the size control buttons, you will have complete control of what happens. However, let me advise you that in such a case much longer times will be required for font refresh. There are long delays when the system tries to show the webfont test file. This effect occurs both when the webfont test file is loaded for the first time and when you press one of the size control buttons and change the whole set of font sizes. This is due to the anomalous properties of the webfont test file, that is extremely demanding in terms of computing power, and can't be qualified as a normal HTML file for its exaggerate font requirements. The operation that takes time is the rendering of eleven TrueType webfonts at once (with seven HTML sizes per webfont). Using the rendering times mentioned above, you must expect 6 to 14 seconds of delay when you press a size control button (or 8 to 18 seconds if you have installed the pseudo-webfonts, too). Anyway, let me remark again that, during normal browser operation, you will never encounter web pages containing the huge number of fonts and sizes required by the webfont test file, so the font rendering process will always require a less intensive (almost unappreciable) activity. The observed delays are also the effect of a specific philosophy of font handling. AWeb does not require that all possible webfont sizes are generated in advance as soon as it is run, but asks the OS for the glyphs in real time, just when they are explicitly required. Browsers that cause the generation of all webfont sizes soon, will have a very long start phase but will react instantly later. It's time to see in detail the full set of fonts that can be displayed. Look at the webfont test file, press the "Reduce" button only one time and then wait until the font refresh happens. See the result: the sizes of all the fonts displayed are collectively reduced. Press "Reduce" again, wait, and see. Repeat. You will reach the set of minimal font sizes either after 8 clicks on the "Reduce" button or, if you have no patience, pressing directly the "TinyFonts" button. Further clicks on the "Reduce" button will have no effect. But you can go backwards through the font size scale pressing the "Enlarge" button. Note that every time you go to a set of font sizes already displayed, the font refresh is almost immediate, because those fonts were already rendered. As you know, you may also reach directly the set of font sizes from which you started: just press the "MidFonts" button. Now you can explore the range of larger fonts. Press the "Enlarge" button only one time and then wait until the font refresh happens. See the result: the sizes of all the fonts displayed are collectively enlarged. You will reach the set of maximal font sizes either after 16 clicks on the "Enlarge" button or pressing directly the "HugeFonts" button. Further clicks on the "Enlarge" button will have no effect. But you can go backwards throughout the whole font size scale pressing the "Reduce" button. Note that, even in this case, font refresh will be almost immediate whenever you go to a set of font sizes already displayed. If you ask for the reasons that justify the adoption of the previous range of sizes for dynamic font management, please note that I simply cloned the number of steps used in Firefox basic range of typographic sizes (25 sizes, 24 steps). This number of steps is cloned in the corresponding Pegasos/MorphOS basic range described in the previous section. Of course, the internal settings of WebfontManager.awebrx ensure that the on-screen aspect of Firefox fonts is cloned throughout the entire range of possible sizes.
Click on the test images shown above and look at the webfont test file as it is displayed by Firefox at the center and the extremes of its font range. Now you can compare these pictures with those generated by AWeb: open the webfont test file with AWeb, and press the "TinyFonts", "MidFonts", or "HugeFonts" button. Now let's go to customise font sizes for your taste. Load a number of well-known web pages or HTML files, and go up and down through the range of fonts with the new AWeb buttons, until the pages are displayed like you prefer. Then open the "Settings" menu and select "Save current settings". From now on the "MidFonts" button is associated to your favorite setting, so you can restore it on the fly after any sequence of font size changes done with the other buttons. In such a way you will possibly change the default font configuration chosen be me, according to my taste. If you think that on the fly recovering of such a default configuration can be useful, you can define another button in the AWeb GUI (as explained above), and associate the label "RefFonts" and the command "RUN AWebPath:Plugins/WebfontManager.awebrx REF" to it. There is another AWeb button whose function was not yet described: "SSSToggle", i.e. "serif/sans-serif toggle". This emulates another feature of Firefox, that is the possibility to choose whether the default proportional font must be sans-serif (usually "Arial" on a PC) or serif (usually "Times New Roman" on a PC). Here, a mouse click on the "SSSToggle" button will switch instantaneously the default proportional font between sans-serif ("Arial") and serif ("Times New Roman"), and vice versa. Please note that only unspecified proportional fonts (without last resort selections) are affected. If you want to see an example, load this HTML page and press "SSSToggle" a number of times. In view of the general rule stated in a previous section), the default proportional font is sans-serif ("Arial"). If you want to set permanently the opposite choice, press "SSSToggle" and switch to "Times New Roman", then open the "Settings" menu of AWeb and select "Save current settings". The features of WebfontManager.awebrx described until now are frequently used. Thus they were associated to buttons in the GUI of AWeb because in such a way they are immediately available to the user. However, there is another group of Firefox font features that were cloned and embodied into WebfontManager.awebrx. These features can be set within the program because, usually, they are tested and tuned in the configuration phase, and then are never changed. It is possible that in the future I will create a MUIrexx GUI for WebfontManager.awebrx, where the user will be able to set these features in a more comfortable way. But now you should be aware that a decent text editor is needed (e.g. CygnusEd, MorphEd, GoldEd, MicroGoldEd, JanoEditor, etc.). In fact, you should make some simple editations directly inside the WebfontManager.rexx program, changing some markers or values in the initialization section of the routine.
Finally, other two types of settings (not present in Firefox) are available for further font customisation.
|
|||||||||||||
|
|
|||||||||||||