1. fonts
Hi guys,
I have just dispatched an update of my font package to RDS, so I hope
it will appear on the Recent Contributions Page in a day or two. If
you have any problems with it, please please let me know.
Btw, I was very pleased by Ralf's report the package apparently works
with Pete's Neil, but I have not tried it myself yet.
Attached below is the what's.new file, but the main thing is I managed
to finish the demo/tutorial! Enjoy. jiri
-- file : font.new - changes in font.e version 4.30
-- author: jiri babor
-- email : jbabor at paradise.net.nz
-- date : 98-11-05
-- font version 4.30
Changes since the last public release (v 4.20):
New align(i) procedure: to align the *current* font with some
other font with handle i. Especially useful when mixing fonts of
different sizes on the same line.
write_vertical replaced by an 'orientation' mechanism with two new
global routines and a couple of constants:
i = orientation() -- return current line orientation
set_orientation(i) -- set new line orientation
HORIZONTAL = 0 -- default
VERTICAL = 1
prompt() now returns a two element sequence {key, prompt_string},
where key is one of six built-in escape keys: tab, shift-tab, esc,
enter and up or down arrow (Irv's suggestion).
Updated and corrected documentation.
Expanded and corrected demo/tutorial.
More font files updated: cleaned and baseline heights set.
2. fonts
Hi Everybody,
I am about to start another major revision of my font
package. I welcome all reasonable requests/suggestions
and/or contributions.
I have also just fixed a major bug in selector.e, graphical
file requestor used in the font editor. I hope the corrected
file will soon be available from the Official Euphoria Page.
Jiri
3. Re: fonts
Babo Jiri wrote:
>I am about to start another major revision of my font
>package. I welcome all reasonable requests/suggestions
>and/or contributions.
>
Thanks Jiri,
I am not sure if the following suggestion is reasonable or not, anyway
i hope this helps.
In your "fgets" routine, it may be desirable that the "fgets" have
at least one "excape" key to cancel the input, that is, for example, if
the "ESC" key is pressed, make "fgets" routine return void string or -1
that means the input is cancelled.
I think it may be more desirable if you make it for user to define "excape"
keys during input of "fgets". Please see the example code below. The codes
below was written to be used in text mode, you can see that the global
variable variable "out_keys" in the codes can be defined by the user.
The reason that i make the "excape" key definable is that, in some times,
the UP or DOWN arrow keys or other keys often used to excape out of an input
field and go to next input field. In my codes below, the "excape" key and
the string itself both are returned from the function, but i think it may be
better that the excape key should be set into global variable and the only
the string itself should be returned from the function, when you revise your
"fgets".
One more thing, the burp sound when invalid key is pressed in "fgets" is too
big in my computer. Please enable user to select the sound on or off.
Sorry for my poor english... i hope you can...
Bye, - Lee, woo seob
--------------------------- code starts here ----------------------------
include graphics.e
include get.e
global constant UP=328, DOWN=336, LEFT=331, RIGHT=333, PGUP=329,
PGDN=337,
HOME=327, END=335, BACK=8, DELETE=339, ESC=27,
ENTER=13,
ALT_Y=277, CTRL_Y=25, INSERT=338
global procedure prints(sequence bt, sequence rc, sequence string)
sequence s
integer ca0,ca,ch
ca0=bt[1]*16
ca=ca0+bt[2]
s={}
for i=1 to length(string) do
ch=string[i]
if ch>255 then ca=ca0+ch-256 else s=s&{ch,ca} end if
end for
poke(#B8000+(rc[1]-1)*160+(rc[2]-1)*2,s)
end procedure
global integer insert
global sequence out_keys
global function reads(sequence bt, sequence rc, integer w, sequence
s)
integer p,ls,key
if insert then cursor(#0207)
else cursor(UNDERLINE_CURSOR)
end if
p=1
while 1 do
ls=length(s)
if ls>w then s=s[1..w] ls=w end if
if p>w then p=w end if
prints(bt,rc,s&repeat(32,w-ls))
position(rc[1],rc[2]+p-1)
key=wait_key()
if key>31 and key<256 then
if insert then s=s[1..p-1]&key&s[p..ls]
elsif p<=ls then s[p]=key
else s=s&key
end if
p=p+1
elsif key=BACK then
if p>1 then s=s[1..p-2]&s[p..ls] p=p-1 end if
elsif key=DELETE then
if p<=ls then s=s[1..p-1]&s[p+1..ls] end if
elsif key=ALT_Y then
s=s[1..p-1]
elsif key=CTRL_Y then
s={} p=1
elsif key=INSERT then
insert=not insert
if insert then cursor(#0207)
else cursor(UNDERLINE_CURSOR)
end if
elsif key=LEFT then
if p>1 then p=p-1 end if
elsif key=RIGHT then
if p<=ls then p=p+1 end if
elsif key=HOME then
p=1
elsif key=END then
p=ls+1
elsif find(key,out_keys) then
return {key,s}
end if
end while
end function
insert=1 -- default setting of insert mode (replace=0)
out_keys={ENTER,ESC} -- default setting of excape keys
------------------------- example program --------------------
object junk
cursor(NO_CURSOR)
prints({BLACK,WHITE},{1,1},"ASCII 32~255 is accepted as normal
characters")
prints({BLACK,WHITE},{2,1},"Edit keys: Back, Delete, @Y, ^Y, Insert,
Left, Right, Home, End")
prints({BLACK,WHITE},{3,1},"Excape keys defined: Enter, Esc")
junk=reads({BLUE,WHITE},{10,10},30,"100,200,300")
junk=graphics_mode(-1)
-------------------------- codes end here ----------------------------------