EASy68K  
It is currently Wed Sep 18, 2019 10:04 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: TRAP 21
PostPosted: Mon Apr 25, 2011 5:57 pm 
Offline

Joined: Thu Apr 21, 2011 4:26 pm
Posts: 9
Location: BRIGHTON
HOW TO MAKE USE OF TRAP 21 TO SET THE FONT COLOR AND STYLE

_________________
ANIKET
BRIGHTON,UK


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 25, 2011 7:01 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
lokmanwar wrote:
HOW TO MAKE USE OF TRAP 21 TO SET THE FONT COLOR AND STYLE


There is example code
Code:
BLACK   EQU             $00000000
MAROON  EQU             $00000080
GREEN   EQU             $00008000
OLIVE   EQU             $00008080
NAVY    EQU             $00800000
PURPLE  EQU             $00800080
TEAL    EQU             $00808000
GRAY    EQU             $00808080
RED     EQU             $000000FF
LIME    EQU             $0000FF00
YELLOW  EQU             $0000FFFF
BLUE    EQU             $00FF0000
FUCHSIA EQU             $00FF00FF
AQUA    EQU             $00FFFF00
LTGRAY  EQU             $00C0C0C0
WHITE   EQU             $00FFFFFF

FONT    EQU             $01090000               Fixedsys, 9 point, normal

;...

        move.l  #WHITE,d1                       font color
        move.l  #FONT,d2                        font name, size and style
        move.b  #21,d0
        trap    #15                             set font properties


Then there is the manual/help/documentation
Code:
 Set font properties where:
    D1.L is color as 0x00BBGGRR
        BB is amount of blue from 0x00 to 0xFF
        GG is amount of green from 0x00 to 0xFF
        RR is amount of red from 0x00 to 0xFF
    D2.L
        Low word is style by bits 0 = off, 1 = on
            bit0 is Bold
            bit1 is Italic
            bit2 is Underline
            bit3 is StrikeOut
        High word (low byte) is Size in points (High word = 0, keep current font)
            8, 9, 10, 11, 12, 14, 16, 18 (not all sizes are valid for all fonts)
            Font sizes in multiples of valid sizes ( size * n) results in a scaled appearance. For example:
            in Fixedsys font sizes of 9*2, 9*3, ..9*n will result in larger characters but the characters will have
            pixelated edges.
        High word (high byte) is Font
            1 is Fixedsys (valid sizes: 9)
            2 is Courier (valid sizes: 10, 12, 15)
            3 is Courier New (valid sizes 8,9,10,11,12,14,16,18)
            4 is Lucida Console (valid sizes 8,9,10,11,12,14,16,18)
            5 is Lucida Sans Typewriter (valid sizes 8,9,10,11,12,14,16,18)
    Example: D2.L = $01090005 is Fixedsys, 9 point, Bold Underline


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group