project-navigation
Personal tools

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - sunsolzn

Pages: [1]
1
Coding / wrap chinese text
« on: November 24, 2008, 09:02:23 am »
I try to first find one line max len,than back find '-' or ' '.
Code: [Select]
static int R_FontFindFit (const font_t *f, char *text, int maxlen, int maxWidth, int *widthp)
{
int bestbreak = 0;
int width;
int len;

*widthp = 0;
width = R_FontChunkLength(f, text, maxlen);
if (width<=maxWidth) {
*widthp = width;
return maxlen-1;
}

/*  Break first word anywhere. */
for (len = max(6,maxlen*maxWidth/width)-5; len < maxlen; len++) {
if (UTF8_CONTINUATION_BYTE(text[len]))
continue;
width = R_FontChunkLength(f, text, len);
if (width > maxWidth)
break;
bestbreak = len;
*widthp = width;
}

/** @todo Smart breaking of Chinese text */
/* Fit whole words */ /* Fit hyphenated word parts */
/* last 1/6 Width to find break */
for (len = bestbreak; len > (bestbreak - bestbreak/6); len--) {
if (text[len] == ' ' || text[len] == '-') {
width = R_FontChunkLength(f, text, len);
bestbreak = len;
*widthp = width;
break;
}
}

return bestbreak;
}

in ufopedia this is ok,but in 3D Geoscape can't display  basename or nation name .

[attachment deleted by admin]

2
Feature Requests / 2.3dev can't go up stairs ,that is map error?
« on: October 17, 2008, 02:06:58 pm »
I try change map,
remove some step
or change slope
then i can play to 2 level :D :D :D :D :D


[attachment deleted by admin]

3
Translating / Chinese translation
« on: September 26, 2008, 03:19:30 pm »
This is my first translation, my English is not very good, 66% translated, with some of the google translation. Font file using the windows bring simsun.ttc, in the display windows, where the normal 1024X768.
 :o :o :o ::) ::) :o :o
zh_cn.po in attach zip file.

Pages: [1]