4 * Copyright 2007 Jesse Allen
5 * Copyright 2008 Massimo Del Fedele
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #include "wine/port.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(dibdrv
);
30 /**********************************************************************
33 COLORREF
DIBDRV_SetTextColor( DIBDRVPHYSDEV
*physDev
, COLORREF color
)
39 TRACE("physDev:%p, color:%x\n", physDev
, color
);
41 /* do nothing if color is the same as actual one */
42 if(color
== physDev
->textColor
)
45 /* stores old color */
46 oldColor
= physDev
->textColor
;
48 /* fills the text color table used on antialiased font display */
49 if(physDev
->bmp
.funcs
)
54 for(i
= 0; i
< 256; i
++)
56 physDev
->bmp
.textColorTable
[i
] = physDev
->bmp
.funcs
->colorref_to_pixel(&physDev
->bmp
, RGB(
65 /* returns previous text color */
69 /***********************************************************************
72 HFONT
DIBDRV_SelectFont( DIBDRVPHYSDEV
*physDev
, HFONT hfont
, GdiFont
*gdiFont
)
76 FT_CharMap charmap
= NULL
;
80 FIXME("physDev:%p, hfont:%p, gdiFont:%p\n", physDev
, hfont
, gdiFont
);
82 /* gets font information */
83 GetObjectW(hfont
, sizeof(lf
), &lf
);
84 TRACE("Font is : '%s'\n", debugstr_w(lf
.lfFaceName
));
86 /* FIXME: just handles gdifont, don't know if it needs to handle hfont too
87 BTW, still don't know how to get FT_Face from non-gdi font here
91 FIXME("No gdi font - unhandled by now.\n");
95 physDev
->face
= gdiFont
->ft_face
;
98 FIXME("Error, null Ft_Face\n");
102 /* setup the correct charmap.... maybe */
103 for (i
= 0; i
< physDev
->face
->num_charmaps
; ++i
)
105 if (physDev
->face
->charmaps
[i
]->platform_id
!= TT_PLATFORM_MICROSOFT
)
108 if (physDev
->face
->charmaps
[i
]->encoding_id
== TT_MS_ID_UNICODE_CS
)
110 charmap
= physDev
->face
->charmaps
[i
];
116 WARN("Selected fallout charmap #%d\n", i
);
117 charmap
= physDev
->face
->charmaps
[i
];
122 WARN("No Windows character map found\n");
123 charmap
= physDev
->face
->charmaps
[0];
127 error
= pFT_Set_Charmap(physDev
->face
, charmap
);
128 if (error
!= FT_Err_Ok
)
130 ERR("%s returned %i\n", "FT_Set_Charmap", error
);
134 /* we use GDI fonts, so just return false */
138 /***********************************************************************
139 * DIBDRV_EnumDeviceFonts
141 BOOL
DIBDRV_EnumDeviceFonts( DIBDRVPHYSDEV
*physDev
, LPLOGFONTW plf
,
142 FONTENUMPROCW proc
, LPARAM lp
)
144 TRACE("physDev:%p, plf:%p, proc:%p, lp:%lx\n", physDev
, plf
, proc
, lp
);
146 /* don't enumerate x11 fonts, we're using client side fonts */
150 /***********************************************************************
151 * DIBDRV_GetTextMetrics
153 BOOL
DIBDRV_GetTextMetrics( DIBDRVPHYSDEV
*physDev
, TEXTMETRICW
*metrics
)
155 TRACE("physDev:%p, metrics:%p\n", physDev
, metrics
);
157 /* no need for this one, as we use GDI fonts */
161 /***********************************************************************
162 * DIBDRV_GetCharWidth
164 BOOL
DIBDRV_GetCharWidth( DIBDRVPHYSDEV
*physDev
, UINT firstChar
, UINT lastChar
,
167 TRACE("physDev:%p, firstChar:%d, lastChar:%d, buffer:%pn", physDev
, firstChar
, lastChar
, buffer
);
169 /* no need for this one, as we use GDI fonts */