Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Cameron Cawley
Browse
Commits
debc0b8f
Commit
debc0b8f
authored
27 years ago
by
Kevin Bracey
Browse files
Options
Download
Email Patches
Plain Diff
Stopped Images.c using Font SWIs instead of fm functions
parent
a28afa84
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
22 deletions
+17
-22
c/FontManage
c/FontManage
+5
-0
c/Images
c/Images
+12
-22
No files found.
c/FontManage
View file @
debc0b8f
...
...
@@ -1461,6 +1461,9 @@ void fm_shutdown(void)
/* */
/* Pointer to an int, into which the */
/* calculated width is placed. */
/* */
/* Assume: The two int pointers may not be */
/* NULL. */
/*************************************************/
_kernel_oserror
*
fm_get_string_width
(
fm_face
h
,
const
char
*
s
,
int
maxwid
,
int
maxbytes
,
...
...
@@ -1545,9 +1548,11 @@ _kernel_oserror * fm_get_string_width(fm_face h, const char * s, int maxwid, int
/* The system font case. */
int
wCurr
,
wLastSplit
,
oLastSplit
,
oCurr
;
/* (Macro defined in FontManage.h). Important that we take */
/* account of rounding correctly - compare with formula in */
/* fm_puts(). */
int
wChar
=
(
FM_System_Size_X
(
h
)
*
10
/
(
128
*
wimpt_dx
()))
*
wimpt_dx
()
*
400
;
wCurr
=
wLastSplit
=
oLastSplit
=
oCurr
=
0
;
...
...
This diff is collapsed.
Click to expand it.
c/Images
View file @
debc0b8f
...
...
@@ -3027,7 +3027,7 @@ _kernel_oserror * image_redraw(browser_data * b, WimpRedrawWindowBlock * r, HStr
/* Have got some ALT text. First find out the bounding box */
/* needed to contain that text. */
int
h
,
ymin
,
xpos
,
vcent
,
stringwidth
,
stringheight
,
size
;
int
h
,
xpos
,
vcent
,
stringwidth
,
stringheight
,
size
,
dummy
;
BBox
fbox
;
BBox
*
ibox
=
NULL
;
...
...
@@ -3046,32 +3046,22 @@ _kernel_oserror * image_redraw(browser_data * b, WimpRedrawWindowBlock * r, HStr
/* Find the string width of the ALT text */
_swix
(
Font_SetFont
,
_IN
(
0
),
h
);
_swix
(
Font_StringWidth
,
_INR
(
1
,
5
)
|
_OUT
(
2
),
tp
->
text
,
0x1000000
,
0x1000000
,
-
1
,
strlen
(
tp
->
text
),
&
stringwidth
);
fm_get_string_width
(
h
,
tp
->
text
,
0x1000000
,
strlen
(
tp
->
text
),
-
1
,
&
dummy
,
&
stringwidth
);
convert_to_os
(
stringwidth
,
&
stringwidth
);
/* Find the font height */
_swix
(
Font_ReadInfo
,
_IN
(
0
)
|
_OUT
(
2
)
|
_OUT
(
4
),
h
,
&
ymin
,
/* Font BBox ymin */
&
stringheight
);
/* Font BBox ymax */
fm_font_box
(
h
,
&
fbox
);
stringheight
-
=
ymin
;
/* So height =
ymax - ymin
*/
stringheight
=
fbox
.
ymax
-
fbox
.
ymin
;
/* Set xpos to the horizontal offset to plot at. */
/* Remember that 'box' contains the bottom */
...
...
@@ -3080,7 +3070,7 @@ _kernel_oserror * image_redraw(browser_data * b, WimpRedrawWindowBlock * r, HStr
/* Similarly, centre vertically */
vcent
=
(
box
.
ymax
-
stringheight
)
/
2
-
ymin
;
vcent
=
(
box
.
ymax
-
stringheight
)
/
2
-
fbox
.
ymin
;
if
(
vcent
<=
0
)
vcent
=
10
;
vcent
+=
box
.
ymin
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment