Masao Uebayashi
uebay****@pulte*****
2004年 2月 25日 (水) 19:43:13 JST
openi18n から svn でソースが取れるんですけど、そっち用のパッチです。コ
ンパイルだけ確認して動作確認してません。
Index: stable/st/include/sttypes.h
===================================================================
--- stable/st/include/sttypes.h (revision 40)
+++ stable/st/include/sttypes.h (working copy)
@@ -51,6 +51,7 @@
#ifndef __STTYPES_H
#define __STTYPES_H
+#include <sys/stdint.h>
#include <sys/types.h>
Index: stable/st/STFontServer/src/fontfamilymanager.c
===================================================================
--- stable/st/STFontServer/src/fontfamilymanager.c (revision 40)
+++ stable/st/STFontServer/src/fontfamilymanager.c (working copy)
@@ -440,9 +440,9 @@
static int FindFamilyInsertionPointByName(OpaqueFontFamilyManager *p, TUStringPtr *familynames, int familynamecnt)
{
- int i, l = 0, r = p->curslots-1;
+ int i, l = 0, r = p->curslots - 1;
- if (p->curslots == 0) return NULL;
+ if (p->curslots == 0) return 0;
do {
int c;
@@ -457,9 +457,9 @@
static int FindFamilyInsertionPointByID(OpaqueFontFamilyManager *p, uint32_t familyID)
{
- int i, l = 0, r = p->curslots-1;
+ int i, l = 0, r = p->curslots - 1;
- if (p->curslots == 0) return NULL;
+ if (p->curslots == 0) return 0;
do {
i = (l + r) >> 1;
@@ -523,9 +523,9 @@
static int FindFontInsertionPoint(OpaqueFontFamilyManager *p, uint32_t fontID)
{
- int i, l = 0, r = p->curfonts-1;
+ int i, l = 0, r = p->curfonts - 1;
- if (p->curfonts == 0) return NULL;
+ if (p->curfonts == 0) return 0;
do {
i = (l + r) >> 1;
Index: stable/st/STFontServer/src/fontenumerator.c
===================================================================
--- stable/st/STFontServer/src/fontenumerator.c (revision 40)
+++ stable/st/STFontServer/src/fontenumerator.c (working copy)
@@ -1622,7 +1622,7 @@
STStatus FontEnumeratorFindFontsForSignature(FontEnumerator fe, byte signature[16], uint32_t *fontID)
{
OpaqueFontEnumerator *f = (OpaqueFontEnumerator *) fe;
- int i, n = 0;
+ int i;
FSFontRecordPtr fp;
STStatus ret = ST_FONT_NOT_FOUND;
Index: stable/st/STFontServer/src/genoffsets.py
===================================================================
--- stable/st/STFontServer/src/genoffsets.py (revision 40)
+++ stable/st/STFontServer/src/genoffsets.py (working copy)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2.2
# -*- coding: iso-8859-1 -*-
#
# Copyright ゥ 2003 Sun Microsystems, Inc.
Index: stable/st/STFontServer/src/fontenumerator.h
===================================================================
--- stable/st/STFontServer/src/fontenumerator.h (revision 40)
+++ stable/st/STFontServer/src/fontenumerator.h (working copy)
@@ -201,12 +201,13 @@
uint32_t **ofontid); // pointer to allocated array of font IDs
- STStatus FontEnumeratorDestroyFonts(FontEnumerator fe, intptr_t cred, int fontcount, uint32_t *fontids);
+ STStatus FontEnumeratorDestroyFonts(FontEnumerator, intptr_t, int, uint32_t *);
- STStatus FontEnumeratorGetFontSignature(FontEnumerator, uint32_t fontID, byte signature[16]);
- STStatus FontEnumeratorFindFontsForSignature(FontEnumerator, byte signature[16], uint32_t *fontID);
+ STStatus FontEnumeratorGetFontSignature(FontEnumerator, uint32_t, byte [16]);
+ STStatus FontEnumeratorFindFontsForSignature(FontEnumerator, byte [16], uint32_t *);
- STStatus FontEnumeratorSave(FontEnumerator fe, const char *filename);
+ STStatus FontEnumeratorSave(FontEnumerator, const char *);
+ STStatus FontEnumeratorRestore(const char *, FontEnumerator *);
#ifdef __cplusplus
}
Index: stable/st/STFontServer/dropins/freetype2/makefile
===================================================================
--- stable/st/STFontServer/dropins/freetype2/makefile (revision 40)
+++ stable/st/STFontServer/dropins/freetype2/makefile (working copy)
@@ -3,12 +3,12 @@
include $(TOP)/st.mk
-FREETYPE=freetype-2.1.4
+FREETYPE=freetype-2.1.7
ifeq ($(BUILD_FT2), yes)
FT_INC=-I$(FREETYPE)/include
FT_LIB_DEP=$(FREETYPE)/objs/.libs/libfreetype.so
-FT_LIBS= $(FREETYPE)/objs/*.lo -lz
+FT_LIBS= $(FREETYPE)/objs/*.o -lz
endif
Index: stable/st/stsflib/stsfutil.c
===================================================================
--- stable/st/stsflib/stsfutil.c (revision 40)
+++ stable/st/stsflib/stsfutil.c (working copy)
@@ -332,6 +332,7 @@
void MemoryChecksum(byte *ptr, size_t count, byte *checksum)
{
+#if defined(USE_CHECKSUMS)
#if defined(USE_MD5DATA)
MD5_CTX context;
#endif
@@ -357,6 +358,7 @@
MD4Final(checksum, &context);
/* MD4Data(f->ptr, count, checksum); */
#endif
+#endif
}
@@ -369,6 +371,7 @@
void GetChecksum(FileImage *f, size_t count, byte *checksum)
{
+#if defined(USE_CHECKSUMS)
#if defined(USE_MD5DATA)
MD5_CTX context;
#endif
@@ -399,12 +402,10 @@
MD4Final(checksum, &context);
/* MD4Data(f->ptr, count, checksum); */
#endif
+#endif
}
-
-
-
#if 0
/* XXX figure out why uncompress returns -3 */
Index: stable/st/stsflib/psscan.c
===================================================================
--- stable/st/stsflib/psscan.c (revision 40)
+++ stable/st/stsflib/psscan.c (working copy)
@@ -960,7 +960,7 @@
int ret = FALSE;
while ((t = PSScannerGetToken(pss, tok)) != t_endfile) {
- if (t == t_name && (LStringCompareToCStr(tok->sval, name) == NULL)) {
+ if (t == t_name && (LStringCompareToCStr(tok->sval, name) == 0)) {
ret = TRUE;
break;
/* return TRUE; */
Index: stable/st/stsflib/langtrans.c
===================================================================
--- stable/st/stsflib/langtrans.c (revision 40)
+++ stable/st/stsflib/langtrans.c (working copy)
@@ -1873,7 +1873,6 @@
if ( lt != NULL ) {
uint32_t index = ST_LANGUAGE ( lang );
int npos = lt->lang_hash_index[index];
- uint32_t fb_index = ST_TERRITORY ( lang ) >> 14;
struct LangHT *ptr = NULL;
/*
Index: stable/st/stsflib/genxstinc.py
===================================================================
--- stable/st/stsflib/genxstinc.py (revision 40)
+++ stable/st/stsflib/genxstinc.py (working copy)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2.2
# -*- coding: iso-8859-1 -*-
#
Index: stable/st/stsflib/makefile
===================================================================
--- stable/st/stsflib/makefile (revision 40)
+++ stable/st/stsflib/makefile (working copy)
@@ -64,7 +64,7 @@
stsfutil.o: stsfutil.c xstmaps.inc
xstmaps.inc: xstmaps.src genxstinc.py
- /usr/bin/env python genxstinc.py
+ /usr/bin/env python2.2 genxstinc.py
clean clean-all:
rm -f *.o *.d *.so *.so.1 *~ *core *.a *_pure*
Index: stable/st/STClientLibrary/src/STLine.c
===================================================================
--- stable/st/STClientLibrary/src/STLine.c (revision 40)
+++ stable/st/STClientLibrary/src/STLine.c (working copy)
@@ -241,14 +241,16 @@
// TODO: Break Iterator Hook will be added here in the next release.
// sameAsLast = TRUE when IteratorEngine[last->position] == IteratorEngine[in->position]
if ( j == p->position + p->charCount ||
+#if HAVE_BIDI
firstPass->embeddingLevel[last->position] != firstPass->embeddingLevel[j] ||
+#endif
last->fontID != in_fontID ||
last_layoutEngID != in_layoutEngID ||
last_scaler != in_scaler) {
STHintingMode hints;
STSbitsMode sbits;
- uint32_t last_fontInstance;
+ uint32_t last_fontInstance = 0;
result = STStyleGetScaler(last->style,NULL,NULL,&hints,&sbits);
if (result != ST_OK) {
@@ -296,7 +298,9 @@
(rrCache->fontInstance == last->fontID) &&
(rrCache->scalerID == last_scaler) &&
(rrCache->layoutEngID == last_layoutEngID) &&
+#if HAVE_BIDI
(rrCache->embeddingLevel == firstPass->embeddingLevel[lastStart->position]) &&
+#endif
(rrCache->charCount == (j - last_jStart))) {
rr = rrCache;
c->u.run = NULL;
@@ -311,7 +315,9 @@
rr->fontInstance = last_fontInstance;
rr->scalerID = last_scaler;
rr->layoutEngID = last_layoutEngID;
+#if HAVE_BIDI
rr->embeddingLevel = firstPass->embeddingLevel[lastStart->position];
+#endif
rr->position = lastStart->position;
rr->charCount = j - last_jStart;
rr->maxSize = 0;
@@ -1905,7 +1911,7 @@
STPoint p2;
STFontMetrics fontMets;
double ax;
- int jj;
+ int jj = 0;
if (p->highlights && (j < glyphs->count)) {
highlight = TextChunkFindByPos ( p->highlights, glyphs->glyphs[j].position );
@@ -2070,7 +2076,7 @@
STPoint p2;
STFontMetrics fontMets;
double bx, by;
- int jj;
+ int jj = 0;
if (p->highlights && (j < glyphs->count)) {
highlight = TextChunkFindByPos ( p->highlights, glyphs->glyphs[j].position );
Index: stable/st/STClientLibrary/src/connection.c
===================================================================
--- stable/st/STClientLibrary/src/connection.c (revision 40)
+++ stable/st/STClientLibrary/src/connection.c (working copy)
@@ -701,7 +701,7 @@
STOpaqueServerSession *s = CheckSession(session);
if (s == NULL) return ST_INTERNAL_ERROR;
- return FSGetFontData(s->fs, iFont, iTable, oByteCount, oRawData);
+ return FSGetFontData(s->fs, iFont, iTable, oByteCount, (byte **)oRawData);
}
STStatus FSSessionLayoutChars(STServerSession session, uint32_t fontInstanceID,
Index: stable/st/STClientLibrary/src/stclprivate.h
===================================================================
--- stable/st/STClientLibrary/src/stclprivate.h (revision 40)
+++ stable/st/STClientLibrary/src/stclprivate.h (working copy)
@@ -59,7 +59,9 @@
#include "stsfutil.h"
#include "langtrans.h"
#include "inlines.h"
+#if HAVE_BIDI
#include <unicode/ubidi.h>
+#endif
#ifdef __cplusplus
@@ -189,7 +191,9 @@
STScaler scalerID;
STLayoutEngine layoutEngID;
STLocale locale;
+#if HAVE_BIDI
UBiDiLevel embeddingLevel;
+#endif
STPosition position;
STCount charCount;
STBoolean RightToLeft;
@@ -207,8 +211,10 @@
int count, maxSize, refCnt;
STBoolean dirty;
glyphCacheEntry *glyphs;
+#if HAVE_BIDI
UBiDi *BiDiParaObj;
UBiDiLevel *embeddingLevel; /* text paragraph */
+#endif
TextChunkManager runs;
STStyledGlyph *styledGlyphs;
STGlyphVector vectorGlyphs;
Index: stable/st/STClientLibrary/src/STGraphics.c
===================================================================
--- stable/st/STClientLibrary/src/STGraphics.c (revision 40)
+++ stable/st/STClientLibrary/src/STGraphics.c (working copy)
@@ -297,7 +297,6 @@
STGraphicsColorMask iWhichColor,
STRGBAColor *oColor)
{
- int n;
STStatus ret = ST_OK;
STOpaqueGraphics *g = (STOpaqueGraphics *) iGraphics;
Index: stable/st/STClientLibrary/src/STGlyphVector.c
===================================================================
--- stable/st/STClientLibrary/src/STGlyphVector.c (revision 40)
+++ stable/st/STClientLibrary/src/STGlyphVector.c (working copy)
@@ -403,7 +403,11 @@
} /*FOLD00*/
+#if __GNUC__
+static void FreeDataManagers(void) __attribute__ ((destructor));
+#else
#pragma fini(FreeDataManagers)
+#endif
static void FreeDataManagers(void)
{
Index: stable/st/STClientLibrary/src/STTextChunk.c
===================================================================
--- stable/st/STClientLibrary/src/STTextChunk.c (revision 40)
+++ stable/st/STClientLibrary/src/STTextChunk.c (working copy)
@@ -376,7 +376,9 @@
int i, levelStart_i;
list levelStart_node, temp;
list result = listNewEmpty();
+#if HAVE_BIDI
UBiDiLevel lowestOddLevel = UBIDI_MAX_EXPLICIT_LEVEL + 1;
+#endif
if (Count == 0)
return result;
@@ -385,8 +387,10 @@
for (i=0; i < Count; i++) {
c = listCurrent(temp);
e = TextChunkGetRun(c);
+#if HAVE_BIDI
if (e->embeddingLevel < lowestOddLevel)
lowestOddLevel = e->embeddingLevel;
+#endif
listNext(temp);
}
listDispose(temp);
@@ -398,6 +402,7 @@
c = listCurrent(temp);
e = TextChunkGetRun(c);
+#if HAVE_BIDI
if (e->embeddingLevel == lowestOddLevel) {
if (lowestOddLevel % 2) {
if (i > levelStart_i) {
@@ -418,11 +423,13 @@
levelStart_node = listNewEmpty();
}
}
+#endif
listNext(temp);
}
listDispose(temp);
+#if HAVE_BIDI
if (lowestOddLevel % 2) {
if (i > levelStart_i)
result = listNewConcat(RunsReorderRecur(levelStart_node, i-levelStart_i), result);
@@ -430,6 +437,7 @@
if (i > levelStart_i)
result = listNewConcat(result, RunsReorderRecur(levelStart_node, i-levelStart_i));
}
+#endif
return result;
}
Index: stable/st/STClientLibrary/src/STText.c
===================================================================
--- stable/st/STClientLibrary/src/STText.c (revision 40)
+++ stable/st/STClientLibrary/src/STText.c (working copy)
@@ -118,6 +118,7 @@
g->runs = NULL;
}
+#if HAVE_BIDI
if ((g->BiDiParaObj != NULL) && (g->refCnt <= 0)) {
if (g->embeddingLevel) {
free(g->embeddingLevel);
@@ -128,6 +129,7 @@
g->BiDiParaObj = NULL;
}
}
+#endif
free(g);
}
return ST_OK;
@@ -143,8 +145,10 @@
}
memset(g, 0, sizeof(glyphCache));
g->refCnt = 1;
+#if HAVE_BIDI
g->BiDiParaObj = ubidi_open();
g->embeddingLevel = NULL;
+#endif
g->runs = NULL;
g->styledGlyphs = NULL;
g->vectorGlyphs = NULL;
@@ -155,7 +159,9 @@
STStatus glyphCacheCopyOnWrite(glyphCache **oCache)
{
STStatus result;
+#if HAVE_BIDI
UErrorCode ErrorCode;
+#endif
if ((*oCache)->refCnt > 1) {
glyphCache *old = *oCache;
@@ -178,6 +184,7 @@
g->count = g->maxSize = 0;
g->glyphs = NULL;
}
+#if HAVE_BIDI
ErrorCode = U_ZERO_ERROR;
g->BiDiParaObj = ubidi_openSized(old->count, 0, &ErrorCode);
if (U_FAILURE(ErrorCode)) {
@@ -191,6 +198,7 @@
} else {
g->embeddingLevel = NULL;
}
+#endif
if (g->runs)
TextChunkManagerCopyOnWrite(g->runs);
if (g->styledGlyphs) {
@@ -1404,8 +1412,10 @@
STFont styleFont;
int outputCount;
STStyleMask styleMask;
+#if HAVE_BIDI
UErrorCode ErrorCode;
UBiDiLevel *pRunLevel;
+#endif
if (g && g->dirty == FALSE) {
*oGlyphs = g;
@@ -1441,6 +1451,7 @@
}
g->maxSize = outputCount;
}
+#if HAVE_BIDI
if (g->embeddingLevel == NULL) {
g->embeddingLevel = malloc(sizeof(UBiDiLevel) * outputCount);
if (g->embeddingLevel == NULL) {
@@ -1448,6 +1459,7 @@
}
g->maxSize = outputCount;
}
+#endif
g->count = 0;
result = STTextFindMissingChars(iText, &segCount, &segOffset,
@@ -1509,10 +1521,12 @@
if (g->glyphs == NULL) {
return ST_MEMORY;
}
+#if HAVE_BIDI
g->embeddingLevel = realloc(g->embeddingLevel, sizeof(UBiDiLevel) * newSize);
if (g->embeddingLevel == NULL) {
return ST_MEMORY;
}
+#endif
g->maxSize = newSize;
}
@@ -1525,6 +1539,7 @@
e->position = pos;
e->charCount = glyphCount;
}
+#if HAVE_BIDI
ErrorCode = U_ZERO_ERROR;
ubidi_setPara(g->BiDiParaObj, (UChar *)p->text, (UTextOffset)(p->charCount),
(UBiDiDirection)(p->direction), NULL, &ErrorCode);
@@ -1543,6 +1558,7 @@
memcpy(g->embeddingLevel, pRunLevel, sizeof(UBiDiLevel)*(p->charCount));
}
}
+#endif
g->dirty = FALSE;
return ST_OK;
}
Index: stable/st/sample_code/stls/Makefile
===================================================================
--- stable/st/sample_code/stls/Makefile (revision 40)
+++ stable/st/sample_code/stls/Makefile (working copy)
@@ -61,12 +61,12 @@
# Needs path to both ST libraries if not in default path
#LIB_PATH=-L/usr/local/lib
#LIB_PATH=-L../../STClientLibrary/src -L../../STFontServer/src -L../../stsflib -R../../STClientLibrary/src -R../../STFontServer/src -R../../stsflib -R/usr/local/lib -L/usr/local/lib
-LIB_PATH=-L../../STClientLibrary/src -L../../STFontServer/src -L../../stsflib
+LIB_PATH=-L../../STClientLibrary/src -L../../STFontServer/src -L../../stsflib -R/usr/pkg/lib
###########
SRCS= stls.c
#LIBS= -lST -lstsf -lSTFontServer -lm -lgiconv
-LIBS+= -lST -lstsf
+LIBS+= -lST -lSTFontServer -lstsf -lfontconfig
OBJS= $(SRCS:%.c=%.o)
all: stls
Index: stable/st/st.mk
===================================================================
--- stable/st/st.mk (revision 40)
+++ stable/st/st.mk (working copy)
@@ -23,7 +23,7 @@
# With NO_INLINES
#DEFINES= -DSTSF -DASSERTS -DSTSF_DEBUG -DRUNTIME_CHECKS -DNO_INLINES -DXST -DSTSF_PAD32
-DEFINES= -DSTSF -DASSERTS -DSTSF_DEBUG -DRUNTIME_CHECKS -DXST -DSTSF_PAD32
+DEFINES= -DSTSF -DASSERTS -DSTSF_DEBUG -DRUNTIME_CHECKS -DXST -DSTSF_PAD32 -UUSE_CHECKSUMS
# *****************************************************************************
#