ununited codes...
Colin (478) 2433 posts |
Try tbxtest.zip just to confirm that it isn’t something different with your machine. When you run the program it should have a button in the window with Ţābā on it. If it does let me know and I’ll try and convert it to use wimp swis instead of using the toolbox – I’m a bit rusty using wimp swis directly so it wasn’t convenient to knock up a test program using them. |
Peter Scheele (2290) 178 posts |
Bull’s eye, Colin, and it converts other names as well like Hòn Chông in Hòn Chông. Looking forward to it! |
Colin (478) 2433 posts |
Good. You will notice however that Al ‗ArÄ«sh displays with a tick because of the wimpsymbol substitution in icons – this wouldn’t be a problem if you used Font_Paint directly. I’ll blow the cobwebs off my template loading. |
Fred Graute (114) 645 posts |
The font handle (which is a byte not a word) needs to be set as part of the flags word. The block you’re writing into is just a copy it’s not used by the Wimp itself.
|
Peter Scheele (2290) 178 posts |
Yes, and the tick is not the only one: Nam Ä‘á»⇑nh is shown with an arrow up: Nam Ð⇑nh instead of an i with a dot at the bottom. But the Ð is correct and the unnecessary characters are left out. There probably will remain a few exceptions and I can live with that. Happy blowing:-) |
Peter Scheele (2290) 178 posts |
@Colin, “leave the cobwebs” I would say (although it is nearly springtime), the suggestion of Fred was the missing link. It shows the chosen font now, in the chosen size and converted as well. @Fred: thank you for your clues! @All: thank you very much for your time and suggestions. |
Rick Murray (539) 13806 posts |
For the nerds, here’s the substitution table: |
Colin (478) 2433 posts |
So the problem is that the alphabet is used to determine utf8 and not font encoding. This should be fixable – come on Rick you know you want to do it. You can use my test program to test it. |
Peter Scheele (2290) 178 posts |
I feel like inspector Colombo: “I have one more question left” The colours of the buttons are grey(2) for the background and blue(8) for the foreground. Bits 24 (Fg colour) and 28 (Bg colour) are now occupied by the fonthandle. Is there any chance to get my colours back? |
Colin (478) 2433 posts |
F28 in the validation string |
Peter Scheele (2290) 178 posts |
Am I right, Rick, that the table is the lacking piece in conversion and, Colin, that Rick can make it 32 bits? |
Peter Scheele (2290) 178 posts |
@Colin: F28 in the validation string. |
Peter Scheele (2290) 178 posts |
The suggested solutions work fine on my machines (RISCOS 5.21 on a Raspberry Pi and 5.16 on Iyonix). But RISCOS Adjust 4.39 (and probably other Adjust versions) gives error 542, it can’t cope with SYS “Font_FindFont”,,“Homerton.Medium\EUTF8”,192,192 TO fonthandl%: it is the \EUTF8 part. I tried to catch the error and fill the handle with “Homerton.Medium” but that chokes the machine. How do I kill the beast instead of the machine? |
Matthew Phillips (473) 719 posts |
RISC OS 4 and 6 do not have the Unicode Font Manager which came from the outset with RISC OS 5. It is possible for users to softload it, I believe, but it would be quite unusual. To catch a SWI error in BASIC you should use the X form of the SWI name: This will return the error instead of raising the error. You will need to return the processor flags and check whether there is an error yourself. Add “;flags%” at the end, so “… TO fonthandl%;flags%” (or your own choice of variable name). Then test using something like It is best to test for the actual error from the SYS call rather than looking at the OS version or Font Manager version to decide what to do. Selecting based on the OS will mean anyone who has installed the Unicode Font Manager on their RISC OS 4/6 machine specially would not get the advantage of it. Make sure you test using a font everyone is going to have though! |
Rick Murray (539) 13806 posts |
I used to use it on RISC OS 3.70 with ANT/Argo Fresco. Dunno if it actually worked, Unicode wasn’t overly common back then and I don’t think the font definitions were that complete either.
That’s the best thing. When I added support to Ovation (sort of), I perform the test as follows:
Essentially, I’m trying to get a handle for a 16pt UTF-8 version of Homerton.Medium (one of the fonts that ought to be built in). If it succeeds, I discard the font handle and note that UTF-8 is available. If it does not succeed, the assumption is that UTF-8 doesn’t exist. Completely untested, but in BASIC this would be something like:
Of course, there are multiple problems at play here. The first is having UTF-8 support, the second is having a font with the characters you require. By way of a lame example, here’s a short program that searches for the katakana “ne” character (ネ). It’ll only return some sort of meaningful result if the user has the Cyberbit font installed, or another with Japanese characters in the correct UCS places. A quick test is…if you’re using RISC OS, can you see the character ‘ネ’ in NetSurf?
|
Chris Mahoney (1684) 2165 posts |
With the base RC14 Pi image, no. I don’t have Cyberbit installed and can’t find a working download for it, but I suspect that it’ll work once I find it. Edit: I found it, installed it, and still no ネ in NetSurf. Edit 2: Cancel that. You need to run the Fonts app manually (presumably rebooting would also work) before NetSurf will pick it up. It’s working now. Yet another edit: The IPAex fonts work too, and in my opinion look better than Cyberbit. They’re open source, rather than “free for non-commercial use” so that’s a plus too. I’ve done a more strenuous test of the IPAex fonts by opening the accompanying readme and licence in Ovation and can confirm that both the ゴシック and 明朝 varieties work. |
Peter Scheele (2290) 178 posts |
@ Matthew and Rick: I put your suggestions – thank you for them – in my code and tested it on my machines: SYS “XFont_FindFont”,,“Homerton.Medium\EUTF8”,192,192 TO fonthandl%;flag% RPi, v 5.21: runs without complains and uses utf8 I found this article: http://iconbar.com/articles/Getting_Unicode_Working_With_RISC_OS_4_and_6/index1267.html |
Rick Murray (539) 13806 posts |
Did you copy-paste that code or type it out again? I ask because:
If bit zero of the flags word is set, that means the prior SWI failed to do its task…
Indeed. So you either have to check for the presence of Unicode fonts and refuse to run if they aren’t found, or to degrade sensibly to standard eight bit Latin. You’re using a “new” feature that wasn’t present on older machines, so there will be some “issues”. I’m surprised the Iyonix doesn’t work – wasn’t the UCS font manager part of the Iyonix ROM? |
Rick Murray (539) 13806 posts |
Chris,
Do you have a font file that you could send me? My memories of creating Cyberbit was that the software was crashy and the process took forever. |
Peter Scheele (2290) 178 posts |
@Rick: Did you copy-paste that code or type it out again? I printed it out, scanned it in, used OCR on my Iyonix, send the text over the network to my RPi and pasted it. I’m joking, because I have no idea what te relation is between: But seriously now: I typed it in. And yes, I saw something as UCS font manager. But never mind, the machine needs an upgrade. BTW: How do you put quotations in such a nice grey bar? It’s not just a grey cell? |
Steve Pampling (1551) 8155 posts |
start the quoted line with bq. (bq dot) for multi-line it’s < blockquote > and the There’s a bit of textile help if you look at the bottom of the page when you are logged in, |
Peter Scheele (2290) 178 posts |
start the quoted line with bq. (bq dot) for multi-line it’s < blockquote > and the Thank you, Steve.
I’ve seen it, but I didn’t realise it was blockquoted. |
Steve Fryatt (216) 2103 posts |
Rick’s suggesting that you’ve got the logic of the IF … THEN statement the wrong way around in your example, and asking if you cut-and-pasted the code or typed it in by hand (in which case, the error could have crept in at that point). I’m not sure that Rick’s correct about the logic being the wrong way around, however. |
Steve Fryatt (216) 2103 posts |
That’s how to quote other people’s posts (although it’s actually “bq dot space”). To quote code in a grey box without Textile messing up the formatting (as much), you use "bc. " (bc dot space) for a single line. bc. IF flags% AND 1 THEN That example’s kind of pleasingly recursive… For multiple lines of code, you start the first line with bc.. (bc dot dot space) and then start the first line of “unboxed” text with p. (p dot space). Something like bc.. SYS “XFont_FindFont”,,“Homerton.Medium\EUTF8”,192,192 TO fonthandl%;flag% IF flag% AND 1 THEN p. This is the first line that's not in the code box... |
Peter Scheele (2290) 178 posts |
Isn’t it just a matter of invariance? IF NOT (f% AND 1) THEN Or IF (f% AND 1) THEN |