1ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/*
2ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *   Copyright (C) 2003, International Business Machines
3ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *   Corporation and others.  All Rights Reserved.
4ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */
5ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid GDISurface::setFont(RenderingFontInstance *font)
6ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    GDIFontInstance *gFont = (GDIFontInstance *) font;
8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    if (fCurrentFont != font) {
10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        fCurrentFont = font;
11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        SelectObject(fHdc, gFont->fFont);
12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    }
13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid GDISurface::drawGlyphs(RenderingFontInstance *font, const LEGlyphID *glyphs, le_int32 count, const le_int32 *dx,
16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    le_int32 x, le_int32 y, le_int32 width, le_int32 height)
17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    RECT clip;
19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    clip.top    = 0;
21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    clip.left   = 0;
22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    clip.bottom = height;
23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    clip.right  = width;
24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    setFont(font);
26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    ExtTextOut(fHdc, x, y - fAscent, ETO_CLIPPED | ETO_GLYPH_INDEX, &clip,
28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        glyphs, count, (INT *) dx);
29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
30ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
31