Fix bullet.library usage
This commit is contained in:
parent
2893e30c4e
commit
2066390555
|
@ -554,7 +554,7 @@ struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle,
|
|||
struct BulletBase *BulletBase = ofont->BulletBase;
|
||||
#endif
|
||||
|
||||
if(ESetInfo(&ofont->olf_EEngine,
|
||||
if(ESetInfo(AMI_OFONT_ENGINE,
|
||||
OT_DeviceDPI, ami_devicedpi,
|
||||
OT_PointHeight, ysize,
|
||||
OT_EmboldenX, emboldenx,
|
||||
|
@ -602,12 +602,12 @@ int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp,
|
|||
#endif
|
||||
}
|
||||
|
||||
if(ESetInfo(&ofont->olf_EEngine,
|
||||
if(ESetInfo(AMI_OFONT_ENGINE,
|
||||
OT_GlyphCode, *char1,
|
||||
OT_GlyphCode2, *char2,
|
||||
TAG_END) == OTERR_Success)
|
||||
{
|
||||
if(EObtainInfo(&ofont->olf_EEngine,
|
||||
if(EObtainInfo(AMI_OFONT_ENGINE,
|
||||
glyphmaptag, &glyph,
|
||||
TAG_END) == 0)
|
||||
{
|
||||
|
@ -639,17 +639,17 @@ int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp,
|
|||
|
||||
kern = 0;
|
||||
|
||||
if(*char2) EObtainInfo(&ofont->olf_EEngine,
|
||||
if(*char2) EObtainInfo(AMI_OFONT_ENGINE,
|
||||
OT_TextKernPair, &kern,
|
||||
TAG_END);
|
||||
|
||||
char_advance = (ULONG)(((glyph->glm_Width - kern) * emwidth) / 65536);
|
||||
|
||||
EReleaseInfo(&ofont->olf_EEngine,
|
||||
EReleaseInfo(AMI_OFONT_ENGINE,
|
||||
glyphmaptag, glyph,
|
||||
TAG_END);
|
||||
|
||||
if(*char2) EReleaseInfo(&ofont->olf_EEngine,
|
||||
if(*char2) EReleaseInfo(AMI_OFONT_ENGINE,
|
||||
OT_TextKernPair, kern,
|
||||
TAG_END);
|
||||
}
|
||||
|
@ -683,12 +683,12 @@ int32 ami_font_width_glyph(struct OutlineFont *ofont,
|
|||
|
||||
if (*char2 < 0x0020) skip_c2 = true;
|
||||
|
||||
if(ESetInfo(&ofont->olf_EEngine,
|
||||
if(ESetInfo(AMI_OFONT_ENGINE,
|
||||
OT_GlyphCode, *char1,
|
||||
OT_GlyphCode2, *char1,
|
||||
TAG_END) == OTERR_Success)
|
||||
{
|
||||
if(EObtainInfo(&ofont->olf_EEngine,
|
||||
if(EObtainInfo(AMI_OFONT_ENGINE,
|
||||
OT_WidthList, &gwlist,
|
||||
TAG_END) == 0)
|
||||
{
|
||||
|
@ -698,23 +698,23 @@ int32 ami_font_width_glyph(struct OutlineFont *ofont,
|
|||
kern = 0;
|
||||
|
||||
if(!skip_c2) {
|
||||
if(ESetInfo(&ofont->olf_EEngine,
|
||||
if(ESetInfo(AMI_OFONT_ENGINE,
|
||||
OT_GlyphCode, *char1,
|
||||
OT_GlyphCode2, *char2,
|
||||
TAG_END) == OTERR_Success)
|
||||
{
|
||||
EObtainInfo(&ofont->olf_EEngine,
|
||||
EObtainInfo(AMI_OFONT_ENGINE,
|
||||
OT_TextKernPair, &kern,
|
||||
TAG_END);
|
||||
}
|
||||
}
|
||||
char_advance = (ULONG)(((char1w - kern) * emwidth) / 65536);
|
||||
|
||||
if(!skip_c2) EReleaseInfo(&ofont->olf_EEngine,
|
||||
if(!skip_c2) EReleaseInfo(AMI_OFONT_ENGINE,
|
||||
OT_TextKernPair, kern,
|
||||
TAG_END);
|
||||
|
||||
EReleaseInfo(&ofont->olf_EEngine,
|
||||
EReleaseInfo(AMI_OFONT_ENGINE,
|
||||
OT_WidthList, gwlist,
|
||||
TAG_END);
|
||||
}
|
||||
|
|
|
@ -21,6 +21,14 @@
|
|||
#include "amiga/os3support.h"
|
||||
#include <libwapcaplet/libwapcaplet.h>
|
||||
|
||||
/* Compatibliity define used by font.c and font_scan.c
|
||||
* It's here because this file is included by both. */
|
||||
#ifdef __amigaos4__
|
||||
#define AMI_OFONT_ENGINE &ofont->olf_EEngine
|
||||
#else
|
||||
#define AMI_OFONT_ENGINE ofont->GEngine
|
||||
#endif
|
||||
|
||||
void ami_font_scan_init(const char *filename, bool force_scan, bool save,
|
||||
lwc_string **glypharray);
|
||||
void ami_font_scan_fini(lwc_string **glypharray);
|
||||
|
@ -28,3 +36,4 @@ void ami_font_scan_save(const char *filename, lwc_string **glypharray);
|
|||
const char *ami_font_scan_lookup(const uint16 *code, lwc_string **glypharray);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
|
|||
STRPTR fname, otagpath;
|
||||
struct BulletBase *BulletBase;
|
||||
struct OutlineFont *of = NULL;
|
||||
struct GlyphEngine *eengine;
|
||||
struct GlyphEngine *gengine;
|
||||
|
||||
otagpath = (STRPTR)ASPrintf("FONTS:%s.otag", fileName);
|
||||
fh = Open(otagpath, MODE_OLDFILE);
|
||||
|
@ -116,9 +116,9 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
|
|||
|
||||
FreeVec(fname);
|
||||
|
||||
eengine = OpenEngine();
|
||||
gengine = OpenEngine();
|
||||
|
||||
SetInfo(eengine,
|
||||
SetInfo(gengine,
|
||||
OT_OTagPath, otagpath,
|
||||
OT_OTagList, buffer,
|
||||
TAG_DONE);
|
||||
|
@ -127,7 +127,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
|
|||
if(of == NULL) return NULL;
|
||||
|
||||
of->BulletBase = BulletBase;
|
||||
of->olf_EEngine = eengine;
|
||||
of->GEngine = gengine;
|
||||
of->OTagPath = otagpath;
|
||||
of->olf_OTagList = buffer;
|
||||
|
||||
|
@ -138,7 +138,7 @@ void CloseOutlineFont(struct OutlineFont *of, struct List *list)
|
|||
{
|
||||
struct BulletBase *BulletBase = of->BulletBase;
|
||||
|
||||
CloseEngine(of->olf_EEngine);
|
||||
CloseEngine(of->GEngine);
|
||||
CloseLibrary(BulletBase);
|
||||
|
||||
FreeVec(of->OTagPath);
|
||||
|
|
|
@ -184,7 +184,7 @@ struct TimeRequest {
|
|||
/* OutlineFont */
|
||||
struct OutlineFont {
|
||||
struct BulletBase *BulletBase;
|
||||
struct GlyphEngine *olf_EEngine;
|
||||
struct GlyphEngine *GEngine;
|
||||
STRPTR OTagPath;
|
||||
struct TagItem *olf_OTagList;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue