windows.uniscribe: support transparency in text color
parent
3d56183360
commit
4a7644e509
|
@ -85,11 +85,14 @@ CONSTANT: ssa-dwFlags flags{ SSA_GLYPHS SSA_FALLBACK SSA_TAB }
|
||||||
! the entire image a rectangle of the given color with varying
|
! the entire image a rectangle of the given color with varying
|
||||||
! transparency.
|
! transparency.
|
||||||
:: color-to-alpha ( image color -- image' )
|
:: color-to-alpha ( image color -- image' )
|
||||||
color >rgba-components drop [ 255 * >integer ] tri@
|
color >rgba-components :> alpha
|
||||||
3byte-array uint32_t deref 24 bits :> rgb
|
[ 255 * >integer ] tri@ 3byte-array uint32_t deref 24 bits :> rgb
|
||||||
image bitmap>> uint32_t cast-array [
|
image bitmap>> uint32_t cast-array
|
||||||
0xff bitand 24 shift rgb bitor
|
alpha 1 <
|
||||||
] map! drop image RGBA >>component-order ;
|
[ [ 0xff bitand alpha * >integer 24 shift rgb bitor ] map! ]
|
||||||
|
[ [ 0xff bitand 24 shift rgb bitor ] map! ]
|
||||||
|
if drop
|
||||||
|
image RGBA >>component-order ;
|
||||||
|
|
||||||
:: render-image ( dc ssa script-string -- image )
|
:: render-image ( dc ssa script-string -- image )
|
||||||
script-string size>> :> size
|
script-string size>> :> size
|
||||||
|
|
Loading…
Reference in New Issue