6 #include <exec/types.h>
7 #include <graphics/gels.h>
8 #include <graphics/rastport.h>
12 #include <proto/dos.h>
13 #include <proto/exec.h>
14 #include <proto/graphics.h>
15 #include <proto/intuition.h>
16 #include <proto/utility.h>
17 #define USE_INLINE_STDARG
18 #include <proto/ttengine.h>
19 #undef USE_INLINE_STDARG
21 #include <proto/scalos.h>
23 #include <clib/alib_protos.h>
26 #include <scalos/scalos.h>
33 #include "scalos_structures.h"
34 #include "functions.h"
35 #include "Variables.h"
37 //----------------------------------------------------------------------------
41 static void SetFamilyTTFont(struct RastPort
*rp
, ULONG style
, struct TTFontFamily
*ttff
);
42 static BOOL
FillTTTextAttrFromDesc(struct TTTextAttr
*ttta
, CONST_STRPTR FontDesc
);
43 static SAVEDS(ULONG
) FontFunctionDispatcher(struct Hook
*hook
, Object
*o
, Msg msg
);
45 //----------------------------------------------------------------------------
49 struct Hook ScalosFontHook
=
52 HOOKFUNC_DEF(FontFunctionDispatcher
), // h_Entry + h_SubEntry
56 SCALOSSEMAPHORE tteSema
;
58 //----------------------------------------------------------------------------
64 //----------------------------------------------------------------------------
66 BOOL
FontUtilInit(void)
68 ScalosInitSemaphore(&tteSema
);
70 return TRUE
; // Success
74 SAVEDS(WORD
) Scalos_TextLength(struct RastPort
*rp
, CONST_STRPTR string
, WORD Length
)
76 d1(kprintf("%s/%s/%ld: TTEngineBase=%08lx rp=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, TTEngineBase
, rp
));
84 STRPTR FontName
= NULL
;
86 TT_GetAttrs(rp
, TT_FontName
, (IPTR
) &FontName
,
94 ScalosObtainSemaphore(&tteSema
);
96 Result
= (WORD
) TT_TextLength(rp
, (STRPTR
) string
, Length
);
98 ScalosReleaseSemaphore(&tteSema
);
105 return TextLength(rp
, (STRPTR
) string
, Length
);
109 SAVEDS(ULONG
) Scalos_TextFit(struct RastPort
*rp
, CONST_STRPTR string
, WORD Length
,
110 struct TextExtent
*textExtent
, struct TextExtent
*constrainingExtent
,
111 WORD strDirection
, UWORD constrainingBitWidth
, UWORD constrainingBitHeight
)
115 d1(kprintf("%s/%s/%ld: TTEngineBase=%08lx rp=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, TTEngineBase
, rp
));
123 STRPTR FontName
= NULL
;
125 TT_GetAttrs(rp
, TT_FontName
, (IPTR
) &FontName
,
128 d1(kprintf("%s/%s/%ld: FontName=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, FontName
));
131 d1(kprintf("%s/%s/%ld: textExtent: %ld %ld %ld %ld\n", __FILE__
, __FUNC__
, __LINE__
, \
132 textExtent
->te_Extent
.MinX
, textExtent
->te_Extent
.MinY
,\
133 textExtent
->te_Extent
.MaxX
, textExtent
->te_Extent
.MaxY
));
134 d1(kprintf("%s/%s/%ld: constrainingExtent=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, constrainingExtent
));
135 d1(kprintf("%s/%s/%ld: constrainingBitWidth=%ld constrainingBitHeight=%ld\n", __FILE__
, __FUNC__
, __LINE__
, constrainingBitWidth
, constrainingBitHeight
));
137 ScalosObtainSemaphore(&tteSema
);
139 Result
= TT_TextFit(rp
,
145 constrainingBitWidth
,
146 constrainingBitWidth
);
148 ScalosReleaseSemaphore(&tteSema
);
150 d1(kprintf("%s/%s/%ld: Result=%lu\n", __FILE__
, __FUNC__
, __LINE__
, Result
));
156 Result
= TextFit(rp
, (STRPTR
) string
, Length
, textExtent
, constrainingExtent
,
157 strDirection
, constrainingBitWidth
, constrainingBitHeight
);
159 d1(kprintf("%s/%s/%ld: Result=%lu\n", __FILE__
, __FUNC__
, __LINE__
, Result
));
165 SAVEDS(void) Scalos_TextExtent(struct RastPort
*rp
, CONST_STRPTR string
, WORD Length
, struct TextExtent
*tExt
)
167 d1(kprintf("%s/%s/%ld: TTEngineBase=%08lx rp=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, TTEngineBase
, rp
));
171 memset(tExt
, 0, sizeof(struct TextExtent
));
178 STRPTR FontName
= NULL
;
180 TT_GetAttrs(rp
, TT_FontName
, (IPTR
) &FontName
,
183 d1(kprintf("%s/%s/%ld: FontName=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, FontName
));
187 d1(kprintf("%s/%s/%ld: FontName=<%s> rp=%08lx TextExtent=%08lx\n", \
188 __FILE__
, __FUNC__
, __LINE__
, FontName
, rp
, tExt
));
190 d1(kprintf("%s/%s/%ld: string=<%s> Length=%ld\n", __FILE__
, __FUNC__
, __LINE__
, string
, Length
));
193 ScalosObtainSemaphore(&tteSema
);
195 d1(kprintf("%s/%s/%ld: \n", __FILE__
, __FUNC__
, __LINE__
));
197 TT_TextExtent(rp
, (STRPTR
) string
, Length
, tExt
);
199 d1(kprintf("%s/%s/%ld: \n", __FILE__
, __FUNC__
, __LINE__
));
202 ScalosReleaseSemaphore(&tteSema
);
204 d1(kprintf("%s/%s/%ld: \n", __FILE__
, __FUNC__
, __LINE__
));
210 TextExtent(rp
, (STRPTR
) string
, Length
, tExt
);
214 SAVEDS(void) Scalos_Text(struct RastPort
*rp
, CONST_STRPTR string
, WORD Length
)
221 STRPTR FontName
= NULL
;
223 TT_GetAttrs(rp
, TT_FontName
, (IPTR
) &FontName
,
226 d1(kprintf("%s/%s/%ld: FontName=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, FontName
));
230 d1(kprintf("%s/%s/%ld: rp=%08lx string=<%s> Length=%ld\n", \
231 __FILE__
, __FUNC__
, __LINE__
, rp
, string
, Length
));
234 ScalosObtainSemaphore(&tteSema
);
236 TT_Text(rp
, (STRPTR
) string
, Length
);
238 ScalosReleaseSemaphore(&tteSema
);
245 Text(rp
, (STRPTR
) string
, Length
);
250 SAVEDS(UWORD
) Scalos_GetFontHeight(struct RastPort
*rp
)
252 if (TTEngineBase
&& rp
)
254 STRPTR FontName
= NULL
;
257 TT_GetAttrs(rp
, TT_FontName
, (IPTR
) &FontName
,
260 d1(kprintf("%s/%s/%ld: rp=%08lx FontName=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, rp
, FontName
));
265 ULONG asc
= 0, desc
= 0;
267 TT_GetAttrs(rp
, TT_FontDesignHeight
, (IPTR
) &Height
,
268 TT_FontRealAscender
, (IPTR
) &asc
,
269 TT_FontRealDescender
, (IPTR
) &desc
,
272 d1(kprintf("%s/%s/%ld: FontName=<%s> DesignHeight=%ld\n", __FILE__
, __FUNC__
, __LINE__
, FontName
, Height
));
273 d1(kprintf("%s/%s/%ld: ascender=%ld descender=%ld\n", __FILE__
, __FUNC__
, __LINE__
, asc
, desc
));
274 return (UWORD
) Height
;
282 SAVEDS(UWORD
) Scalos_GetFontBaseline(struct RastPort
*rp
)
284 d1(kprintf("%s/%s/%ld: rp=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, rp
));
286 if (TTEngineBase
&& rp
)
288 STRPTR FontName
= NULL
;
291 TT_GetAttrs(rp
, TT_FontName
, (IPTR
) &FontName
,
295 d1(kprintf("%s/%s/%ld: FontName=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, FontName
));
301 TT_GetAttrs(rp
, TT_FontAccentedAscender
, (IPTR
) &Baseline
,
304 return (UWORD
) (Baseline
- 2);
308 d1(kprintf("%s/%s/%ld: TxBaseline=%ld tf_Baseline=%ld\n", __FILE__
, __FUNC__
, __LINE__
, rp
->TxBaseline
, rp
->Font
->tf_Baseline
));
310 return (UWORD
) rp
->Font
->tf_Baseline
;
314 SAVEDS(void) Scalos_SetFontTransparency(struct RastPort
*rp
, ULONG Transparency
)
316 if (TTEngineBase
&& rp
)
318 STRPTR FontName
= NULL
;
321 TT_GetAttrs(rp
, TT_FontName
, (IPTR
) &FontName
,
326 d1(kprintf("%s/%s/%ld: rp=%08lx FamilyName=<%s> Transparency=%ld\n", \
327 __FILE__
, __FUNC__
, __LINE__
, rp
, FontName
, Transparency
));
330 ScalosObtainSemaphore(&tteSema
);
333 TT_SetAttrs(rp
, TT_Transparency
, Transparency
,
337 ScalosReleaseSemaphore(&tteSema
);
344 SAVEDS(ULONG
) Scalos_SetSoftStyle(struct RastPort
*rp
, ULONG style
, ULONG enable
, struct TTFontFamily
*ttff
)
348 STRPTR FontName
= NULL
;
351 TT_GetAttrs(rp
, TT_FontName
, (IPTR
) &FontName
,
356 d1(kprintf("%s/%s/%ld: rp=%08lx FamilyName=<%s> style=%08lx enable=%08lx\n", \
357 __FILE__
, __FUNC__
, __LINE__
, rp
, FontName
, style
, enable
));
360 ScalosObtainSemaphore(&tteSema
);
363 TT_SoftStyle
, ((style
& enable
) == FSF_UNDERLINED
)
364 ? TT_SoftStyle_Underlined
: TT_SoftStyle_None
,
368 ScalosReleaseSemaphore(&tteSema
);
370 SetFamilyTTFont(rp
, style
& enable
, ttff
);
374 d1(kprintf("%s/%s/%ld: TxBaseline=%ld tf_Baseline=%ld\n", __FILE__
, __FUNC__
, __LINE__
, rp
->TxBaseline
, rp
->Font
->tf_Baseline
));
376 return SetSoftStyle(rp
, style
, enable
);
380 SAVEDS(void) Scalos_SetFont(struct RastPort
*rp
, struct TextFont
*tf
, struct TTFontFamily
*ttff
)
382 d1(kprintf("%s/%s/%ld: TTEngineBase=%08lx ttFont=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, TTEngineBase
, ttff
));
384 if (tf
&& (rp
->Font
!= tf
))
387 if (TTEngineBase
&& ttff
&& (ttff
->ttff_BoldItalic
|| ttff
->ttff_Bold
|| ttff
->ttff_Italic
|| ttff
->ttff_Normal
))
389 SetFamilyTTFont(rp
, FS_NORMAL
, ttff
);
392 ScalosObtainSemaphore(&tteSema
);
396 TT_Antialias
, CurrentPrefs
.pref_TTFontAntialias
,
397 TT_Gamma
, CurrentPrefs
.pref_TTFontGamma
,
398 TT_ColorMap
, (IPTR
) iInfos
.xii_iinfos
.ii_Screen
->ViewPort
.ColorMap
,
399 // TT_Screen, iInfos.xii_iinfos.ii_Screen,
402 ScalosReleaseSemaphore(&tteSema
);
406 if (NULL
== ttff
|| (NULL
== ttff
->ttff_BoldItalic
&& NULL
== ttff
->ttff_Bold
&&
407 NULL
== ttff
->ttff_Italic
&& NULL
== ttff
->ttff_Normal
))
408 Scalos_DoneRastPort(rp
); // remove TT font
412 static void SetFamilyTTFont(struct RastPort
*rp
, ULONG style
, struct TTFontFamily
*ttff
)
414 BOOL isBold
= style
& FSF_BOLD
;
415 BOOL isItalic
= style
& FSF_ITALIC
;
418 if (isBold
&& isItalic
)
420 d1(kprintf("%s/%s/%ld: rp=%08lx BoldItalic font=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, rp
, ttff
->ttff_BoldItalic
));
421 ttFont
= ttff
->ttff_BoldItalic
;
425 d1(kprintf("%s/%s/%ld: rp=%08lx Bold font=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, rp
, ttff
->ttff_Bold
));
426 ttFont
= ttff
->ttff_Bold
;
430 d1(kprintf("%s/%s/%ld: rp=%08lx Italic font=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, rp
, ttff
->ttff_Italic
));
431 ttFont
= ttff
->ttff_Italic
;
435 d1(kprintf("%s/%s/%ld: rp=%08lx Normal font=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, rp
, ttff
->ttff_Normal
));
436 ttFont
= ttff
->ttff_Normal
;
441 d1(kprintf("%s/%s/%ld: rp=%08lx Fallback to Normal font=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, rp
, ttff
->ttff_Normal
));
442 ttFont
= ttff
->ttff_Normal
;
448 ScalosObtainSemaphore(&tteSema
);
450 TT_SetFont(rp
, ttFont
);
451 d1(kprintf("%s/%s/%ld: rp=%08lx ttFont=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, rp
, ttFont
));
455 TT_Antialias
, CurrentPrefs
.pref_TTFontAntialias
,
456 TT_Gamma
, CurrentPrefs
.pref_TTFontGamma
,
457 TT_ColorMap
, (IPTR
) iInfos
.xii_iinfos
.ii_Screen
->ViewPort
.ColorMap
,
460 ScalosReleaseSemaphore(&tteSema
);
466 APTR
Scalos_OpenTTFont(CONST_STRPTR FontDesc
, struct TTFontFamily
*ttff
)
468 d1(kprintf("%s/%s/%ld: FontDesc=<%s>\n", __FILE__
, __FUNC__
, __LINE__
, FontDesc
));
469 memset(ttff
, 0, sizeof(struct TTFontFamily
));
471 if (TTEngineBase
&& FontDesc
)
473 struct TTTextAttr ttta
;
475 d1(kprintf("%s/%s/%ld: \n", __FILE__
, __FUNC__
, __LINE__
));
477 if (FillTTTextAttrFromDesc(&ttta
, FontDesc
))
479 d1(kprintf("%s/%s/%ld: FamilyName=<%s> Size=%ld\n", \
480 __FILE__
, __FUNC__
, __LINE__
, ttta
.ttta_FamilyTable
[0], ttta
.ttta_FontSize
));
483 ScalosObtainSemaphore(&tteSema
);
487 ttff
->ttff_Normal
= TT_OpenFont(
488 TT_FamilyTable
, (IPTR
) ttta
.ttta_FamilyTable
,
489 TT_FontSize
, ttta
.ttta_FontSize
,
490 TT_FontStyle
, ttta
.ttta_FontStyle
,
491 TT_FontWeight
, ttta
.ttta_FontWeight
,
493 d1(kprintf("%s/%s/%ld: Normal font=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, ttff
->ttff_Normal
));
495 ttff
->ttff_Bold
= TT_OpenFont(
496 TT_FamilyTable
, (IPTR
) ttta
.ttta_FamilyTable
,
497 TT_FontSize
, ttta
.ttta_FontSize
,
498 TT_FontStyle
, TT_FontStyle_Regular
,
499 TT_FontWeight
, TT_FontWeight_Bold
,
501 d1(kprintf("%s/%s/%ld: Bold font=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, ttff
->ttff_Bold
));
503 ttff
->ttff_Italic
= TT_OpenFont(
504 TT_FamilyTable
, (IPTR
) ttta
.ttta_FamilyTable
,
505 TT_FontSize
, ttta
.ttta_FontSize
,
506 TT_FontStyle
, TT_FontStyle_Italic
,
507 TT_FontWeight
, TT_FontWeight_Normal
,
509 d1(kprintf("%s/%s/%ld: Italic font=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, ttff
->ttff_Italic
));
511 ttff
->ttff_BoldItalic
= TT_OpenFont(
512 TT_FamilyTable
, (IPTR
) ttta
.ttta_FamilyTable
,
513 TT_FontSize
, ttta
.ttta_FontSize
,
514 TT_FontStyle
, TT_FontStyle_Italic
,
515 TT_FontWeight
, TT_FontWeight_Bold
,
517 d1(kprintf("%s/%s/%ld: BoldItalic font=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, ttff
->ttff_BoldItalic
));
520 ScalosReleaseSemaphore(&tteSema
);
525 return ttff
->ttff_Normal
;
529 void Scalos_CloseFont(struct TextFont
**tf
, struct TTFontFamily
*ttFont
)
531 if (TTEngineBase
&& ttFont
)
533 d1(kprintf("%s/%s/%ld: Normal font=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, ttFont
->ttff_Normal
));
536 ScalosObtainSemaphore(&tteSema
);
538 TT_CloseFont(ttFont
->ttff_Normal
);
539 TT_CloseFont(ttFont
->ttff_Bold
);
540 TT_CloseFont(ttFont
->ttff_Italic
);
541 TT_CloseFont(ttFont
->ttff_BoldItalic
);
544 ScalosReleaseSemaphore(&tteSema
);
546 ttFont
->ttff_Normal
= NULL
;
547 ttFont
->ttff_Bold
= NULL
;
548 ttFont
->ttff_Italic
= NULL
;
549 ttFont
->ttff_BoldItalic
= NULL
;
560 SAVEDS(void) Scalos_InitRastPort(struct RastPort
*rp
)
567 ScalosObtainSemaphore(&tteSema
);
570 TT_ColorMap
, (IPTR
) iInfos
.xii_iinfos
.ii_Screen
->ViewPort
.ColorMap
,
574 ScalosReleaseSemaphore(&tteSema
);
576 d1(kprintf("%s/%s/%ld: rp=%08lx cm=%08lx\n", \
577 __FILE__
, __FUNC__
, __LINE__
, rp
, iInfos
.xii_iinfos
.ii_Screen
->ViewPort
.ColorMap
));
582 SAVEDS(void) Scalos_DoneRastPort(struct RastPort
*rp
)
584 d1(kprintf("%s/%s/%ld: rp=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, rp
));
589 ScalosObtainSemaphore(&tteSema
);
593 ScalosReleaseSemaphore(&tteSema
);
599 static BOOL
FillTTTextAttrFromDesc(struct TTTextAttr
*ttta
, CONST_STRPTR FontDesc
)
602 // "style/weight/size/fontname"
606 ttta
->ttta_FontStyle
= TT_FontStyle_Regular
;
607 ttta
->ttta_FontWeight
= TT_FontWeight_Normal
;
609 d1(kprintf("%s/%s/%ld: ttta=%08lx FontDesc=<%s>\n", __FILE__
, __FUNC__
, __LINE__
, ttta
, FontDesc
));
611 for (n
= 0; *FontDesc
&& '/' != *FontDesc
&& n
< sizeof(Buffer
) - 1; n
++)
612 Buffer
[n
] = *FontDesc
++;
614 d1(kprintf("%s/%s/%ld: Buffer=<%s>\n", __FILE__
, __FUNC__
, __LINE__
, Buffer
));
616 if (StrToLong(Buffer
, (LONG
*) &ttta
->ttta_FontStyle
) <= 0)
619 if ('/' == *FontDesc
)
620 FontDesc
++; // Skip "/" between style and weight
624 for (n
= 0; *FontDesc
&& '/' != *FontDesc
&& n
< sizeof(Buffer
) - 1; n
++)
625 Buffer
[n
] = *FontDesc
++;
627 d1(kprintf("%s/%s/%ld: Buffer=<%s>\n", __FILE__
, __FUNC__
, __LINE__
, Buffer
));
629 if (StrToLong(Buffer
, (LONG
*) &ttta
->ttta_FontWeight
) <= 0)
632 if ('/' == *FontDesc
)
633 FontDesc
++; // Skip "/" between weight and size
637 for (n
= 0; *FontDesc
&& '/' != *FontDesc
&& n
< sizeof(Buffer
) - 1; n
++)
638 Buffer
[n
] = *FontDesc
++;
640 d1(kprintf("%s/%s/%ld: Buffer=<%s>\n", __FILE__
, __FUNC__
, __LINE__
, Buffer
));
642 if (StrToLong(Buffer
, (LONG
*) &ttta
->ttta_FontSize
) <= 0)
645 d1(kprintf("%s/%s/%ld: ttta=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, ttta
));
647 if ('/' == *FontDesc
)
648 FontDesc
++; // Skip "/" between size and name
652 d1(kprintf("%s/%s/%ld: FontDesc=<%s>\n", __FILE__
, __FUNC__
, __LINE__
, FontDesc
));
655 stccpy(ttta
->ttta_NameSpace
, FontDesc
, sizeof(ttta
->ttta_NameSpace
));
656 ttta
->ttta_FamilyTable
[0] = ttta
->ttta_NameSpace
;
657 ttta
->ttta_FamilyTable
[1] = NULL
;
659 return TRUE
; // Success!
663 static SAVEDS(ULONG
) FontFunctionDispatcher(struct Hook
*hook
, Object
*o
, Msg msg
)
667 d1(kprintf("%s/%s/%ld: hook=%08lx o=%08lx msg=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, hook
, o
, msg
));
668 d1(kprintf("%s/%s/%ld: MethodID=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, msg
->MethodID
));
670 switch (msg
->MethodID
)
672 case iofMsg_DONERASTPORT
:
674 struct ioFontMsg_DoneRastPort
*iofdr
= (struct ioFontMsg_DoneRastPort
*) msg
;
676 Scalos_DoneRastPort(iofdr
->iofdr_RastPort
);
681 struct ioFontMsg_SetFont
*iofsf
= (struct ioFontMsg_SetFont
*) msg
;
683 Scalos_SetFont(iofsf
->iofsf_RastPort
, iofsf
->iofsf_TextFont
, iofsf
->iofsf_FontHandle
);
688 struct ioFontMsg_Text
*ioft
= (struct ioFontMsg_Text
*) msg
;
690 Scalos_Text(ioft
->ioft_RastPort
, ioft
->ioft_String
, ioft
->ioft_Length
);
693 case iofMsg_SETFONTSTYLE
:
695 struct ioFontMsg_SetFontStyle
*iofsfs
= (struct ioFontMsg_SetFontStyle
*) msg
;
697 Result
= Scalos_SetSoftStyle(iofsfs
->iofsfs_RastPort
,
698 iofsfs
->iofsfs_Style
, iofsfs
->iofsfs_Enable
,
699 iofsfs
->iofsfs_FontHandle
);
702 case iofMsg_TEXTEXTENT
:
704 struct ioFontMsg_TextExtent
*iofte
= (struct ioFontMsg_TextExtent
*) msg
;
706 d1(kprintf("%s/%s/%ld: rp=%08lx string=%08lx length=%lu\n", \
707 __FILE__
, __FUNC__
, __LINE__
, iofte
->iofte_RastPort
, iofte
->iofte_String
, iofte
->iofte_Length
));
709 Scalos_TextExtent(iofte
->iofte_RastPort
, iofte
->iofte_String
,
710 iofte
->iofte_Length
, iofte
->iofte_TextExtent
);
715 struct ioFontMsg_TextFit
*ioftf
= (struct ioFontMsg_TextFit
*) msg
;
717 Result
= Scalos_TextFit(ioftf
->ioftf_RastPort
, ioftf
->ioftf_String
,
718 ioftf
->ioftf_Length
, ioftf
->ioftf_TextExtent
,
719 ioftf
->ioftf_ConstrainingTextExtent
, ioftf
->ioftf_StrDirection
,
720 ioftf
->ioftf_ConstrainingBitWidth
, ioftf
->ioftf_ConstrainingBitHeight
);
723 case iofMsg_GETFONTHEIGHT
:
725 struct ioFontMsg_GetFontHeight
*iofgfh
= (struct ioFontMsg_GetFontHeight
*) msg
;
727 Result
= Scalos_GetFontHeight(iofgfh
->iofgfh_RastPort
);
730 case iofMsg_GETFONTBASELINE
:
732 struct ioFontMsg_GetFontBaseline
*iofgfb
= (struct ioFontMsg_GetFontBaseline
*) msg
;
734 Result
= Scalos_GetFontBaseline(iofgfb
->iofgfb_RastPort
);
737 case iofMsg_SETTRANSPARENCY
:
739 struct ioFontMsg_SetTransparency
*iofst
= (struct ioFontMsg_SetTransparency
*) msg
;
741 Scalos_SetFontTransparency(iofst
->iofst_RastPort
, iofst
->iofst_Transparency
);
748 d1(kprintf("%s/%s/%ld: Result=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, Result
));