2001-11-07 23:48:17 +00:00
|
|
|
/*
|
|
|
|
******************************************************************************
|
2003-06-03 20:58:22 +00:00
|
|
|
* Copyright (C) 1998-2003, International Business Machines Corporation and *
|
2001-11-07 23:48:17 +00:00
|
|
|
* others. All Rights Reserved. *
|
|
|
|
******************************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __FONTMAP_H
|
|
|
|
#define __FONTMAP_H
|
|
|
|
|
|
|
|
#include "layout/LETypes.h"
|
|
|
|
#include "layout/LEScripts.h"
|
2003-03-03 23:07:01 +00:00
|
|
|
#include "layout/LEFontInstance.h"
|
2001-11-07 23:48:17 +00:00
|
|
|
|
|
|
|
#include "GUISupport.h"
|
|
|
|
|
|
|
|
#define BUFFER_SIZE 128
|
|
|
|
|
|
|
|
class FontMap
|
|
|
|
{
|
|
|
|
public:
|
2003-03-03 23:07:01 +00:00
|
|
|
FontMap(const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status);
|
2001-11-07 23:48:17 +00:00
|
|
|
|
|
|
|
virtual ~FontMap();
|
|
|
|
|
2003-03-03 23:07:01 +00:00
|
|
|
virtual const LEFontInstance *getScriptFont(le_int32 scriptCode, LEErrorCode &status);
|
|
|
|
|
|
|
|
virtual le_int16 getPointSize() const;
|
|
|
|
|
|
|
|
virtual le_int32 getAscent() const;
|
|
|
|
|
|
|
|
virtual le_int32 getDescent() const;
|
|
|
|
|
|
|
|
virtual le_int32 getLeading() const;
|
2001-11-07 23:48:17 +00:00
|
|
|
|
|
|
|
protected:
|
2003-03-03 23:07:01 +00:00
|
|
|
virtual const LEFontInstance *openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status) = 0;
|
2001-11-07 23:48:17 +00:00
|
|
|
|
|
|
|
char errorMessage[256];
|
|
|
|
|
|
|
|
private:
|
|
|
|
static char *strip(char *s);
|
|
|
|
le_int32 getFontIndex(const char *fontName);
|
2003-03-03 23:07:01 +00:00
|
|
|
void getMaxMetrics();
|
2001-11-07 23:48:17 +00:00
|
|
|
|
|
|
|
le_int16 fPointSize;
|
|
|
|
le_int32 fFontCount;
|
|
|
|
|
2003-03-03 23:07:01 +00:00
|
|
|
le_int32 fAscent;
|
|
|
|
le_int32 fDescent;
|
|
|
|
le_int32 fLeading;
|
|
|
|
|
2001-11-07 23:48:17 +00:00
|
|
|
GUISupport *fGUISupport;
|
|
|
|
|
2003-03-03 23:07:01 +00:00
|
|
|
const LEFontInstance *fFontInstances[scriptCodeCount];
|
2001-11-07 23:48:17 +00:00
|
|
|
const char *fFontNames[scriptCodeCount];
|
|
|
|
le_int32 fFontIndices[scriptCodeCount];
|
|
|
|
};
|
|
|
|
|
2003-03-03 23:07:01 +00:00
|
|
|
inline le_int16 FontMap::getPointSize() const
|
|
|
|
{
|
|
|
|
return fPointSize;
|
|
|
|
}
|
|
|
|
|
2001-11-07 23:48:17 +00:00
|
|
|
#endif
|
|
|
|
|