File: GDIFontInstance.h

package info (click to toggle)
icu 2.1-2.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 38,556 kB
  • ctags: 18,435
  • sloc: cpp: 118,545; ansic: 98,775; makefile: 3,759; sh: 3,178; perl: 1,325; lisp: 3
file content (57 lines) | stat: -rw-r--r-- 1,553 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

/*
 *******************************************************************************
 *
 *   Copyright (C) 1999-2001, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
 *   file name:  GDIFontInstance.h
 *
 *   created on: 08/09/2000
 *   created by: Eric R. Mader
 */

#ifndef __GDIFONTINSTANCE_H
#define __GDIFONTINSTANCE_H

#include <windows.h>

#include "layout/LETypes.h"
#include "RenderingFontInstance.h"
#include "cmaps.h"

class GDIFontInstance : public RenderingFontInstance
{
protected:
    HDC fHdc;
    HFONT fFont;

    virtual const void *readFontTable(LETag tableTag) const;

public:
    GDIFontInstance(HDC theHDC, TCHAR *faceName, le_int16 pointSize, RFIErrorCode &status);
    GDIFontInstance(HDC theHDC, const char *faceName, le_int16 pointSize, RFIErrorCode &status);
    //GDIFontInstance(HDC theHDC, le_int16 pointSize);

    virtual ~GDIFontInstance();

    virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const;

    virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const;

    virtual const void setFont(void *surface) const
    {
        HDC hdc = (HDC) surface;
	GDIFontInstance *real = (GDIFontInstance *) this;

	real->fHdc = hdc;
        SelectObject(hdc, fFont);
    };
    
    virtual void drawGlyphs(void *surface, LEGlyphID *glyphs, le_uint32 count, le_int32 *dx,
        le_int32 x, le_int32 y, le_int32 width, le_int32 height) const;

};

#endif