diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-11-13 00:16:53 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-11-13 00:16:53 +0300 |
commit | bdfe7d89e2f1292644577972c716931b4ce3c6c3 (patch) | |
tree | d00eb50b749cb001e2b08272c91791e66740b05d /source/blender/blenlib/intern/psfont.c | |
parent | 78a1c27c4a6abe0ed31ca93ad21910f3df04da56 (diff) | |
parent | 7e4db234cee71ead34ee81a12e27da4bd548eb4b (diff) |
Merge of trunk into blender 2.5:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r12987:17416
Issues:
* GHOST/X11 had conflicting changes. Some code was added in 2.5, which was
later added in trunk also, but reverted partially, specifically revision
16683. I have left out this reversion in the 2.5 branch since I think it is
needed there.
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16683
* Scons had various conflicting changes, I decided to go with trunk version
for everything except priorities and some library renaming.
* In creator.c, there were various fixes and fixes for fixes related to the -w
-W and -p options. In 2.5 -w and -W is not coded yet, and -p is done
differently. Since this is changed so much, and I don't think those fixes
would be needed in 2.5, I've left them out.
* Also in creator.c: there was code for a python bugfix where the screen was not
initialized when running with -P. The code that initializes the screen there
I had to disable, that can't work in 2.5 anymore but left it commented as a
reminder.
Further I had to disable some new function calls. using src/ and python/, as
was done already in this branch, disabled function calls:
* bpath.c: error reporting
* BME_conversions.c: editmesh conversion functions.
* SHD_dynamic: disabled almost completely, there is no python/.
* KX_PythonInit.cpp and Ketsji/ build files: Mathutils is not there, disabled.
* text.c: clipboard copy call.
* object.c: OB_SUPPORT_MATERIAL.
* DerivedMesh.c and subsurf_ccg, stipple_quarttone.
Still to be done:
* Go over files and functions that were moved to a different location but could
still use changes that were done in trunk.
Diffstat (limited to 'source/blender/blenlib/intern/psfont.c')
-rw-r--r-- | source/blender/blenlib/intern/psfont.c | 566 |
1 files changed, 284 insertions, 282 deletions
diff --git a/source/blender/blenlib/intern/psfont.c b/source/blender/blenlib/intern/psfont.c index cf58f44ad2c..54d7f8ec1af 100644 --- a/source/blender/blenlib/intern/psfont.c +++ b/source/blender/blenlib/intern/psfont.c @@ -43,6 +43,8 @@ #include "DNA_packedFile_types.h" #include "DNA_curve_types.h" +#include "BLO_sys_types.h" // for intptr_t support + #ifdef HAVE_CONFIG_H #include <config.h> #endif @@ -54,7 +56,7 @@ typedef struct chardesc { short llx, lly; /* bounding box */ short urx, ury; short *data; /* char data */ - long datalen; + intptr_t datalen; } chardesc; typedef struct objfnt { @@ -256,290 +258,290 @@ static int sp; static int savesplines = 1; static pschar ISOcharlist[NASCII] = { - "/space", 040, 0, - "/exclam", 041, 0, - "/quotedbl", 042, 0, - "/numbersign", 043, 0, - "/dollar", 044, 0, - "/percent", 045, 0, - "/ampersand", 046, 0, - "/quoteright", 047, 0, - - "/parenleft", 050, 0, - "/parenright", 051, 0, - "/asterisk", 052, 0, - "/plus", 053, 0, - "/comma", 054, 0, - "/hyphen", 055, 0, - "/period", 056, 0, - "/slash", 057, 0, - - "/zero", 060, 0, - "/one", 061, 0, - "/two", 062, 0, - "/three", 063, 0, - "/four", 064, 0, - "/five", 065, 0, - "/six", 066, 0, - "/seven", 067, 0, - - "/eight", 070, 0, - "/nine", 071, 0, - "/colon", 072, 0, - "/semicolon", 073, 0, - "/less", 074, 0, - "/equal", 075, 0, - "/greater", 076, 0, - "/question", 077, 0, - - "/at", 0100, 0, - "/A", 0101, 0, - "/B", 0102, 0, - "/C", 0103, 0, - "/D", 0104, 0, - "/E", 0105, 0, - "/F", 0106, 0, - "/G", 0107, 0, - - "/H", 0110, 0, - "/I", 0111, 0, - "/J", 0112, 0, - "/K", 0113, 0, - "/L", 0114, 0, - "/M", 0115, 0, - "/N", 0116, 0, - "/O", 0117, 0, - - "/P", 0120, 0, - "/Q", 0121, 0, - "/R", 0122, 0, - "/S", 0123, 0, - "/T", 0124, 0, - "/U", 0125, 0, - "/V", 0126, 0, - "/W", 0127, 0, - - "/X", 0130, 0, - "/Y", 0131, 0, - "/Z", 0132, 0, - "/bracketleft", 0133, 0, - "/backslash", 0134, 0, - "/bracketright", 0135, 0, - "/asciicircum", 0136, 0, - "/underscore", 0137, 0, - - "/quoteleft", 0140, 0, - "/a", 0141, 0, - "/b", 0142, 0, - "/c", 0143, 0, - "/d", 0144, 0, - "/e", 0145, 0, - "/f", 0146, 0, - "/g", 0147, 0, - - "/h", 0150, 0, - "/i", 0151, 0, - "/j", 0152, 0, - "/k", 0153, 0, - "/l", 0154, 0, - "/m", 0155, 0, - "/n", 0156, 0, - "/o", 0157, 0, - - "/p", 0160, 0, - "/q", 0161, 0, - "/r", 0162, 0, - "/s", 0163, 0, - "/t", 0164, 0, - "/u", 0165, 0, - "/v", 0166, 0, - "/w", 0167, 0, - - "/x", 0170, 0, - "/y", 0171, 0, - "/z", 0172, 0, - "/braceleft", 0173, 0, - "/bar", 0174, 0, - "/braceright", 0175, 0, - "/asciitilde", 0176, 0, - "/", 0177, 0, + {"/space", 040, 0}, + {"/exclam", 041, 0}, + {"/quotedbl", 042, 0}, + {"/numbersign", 043, 0}, + {"/dollar", 044, 0}, + {"/percent", 045, 0}, + {"/ampersand", 046, 0}, + {"/quoteright", 047, 0}, + + {"/parenleft", 050, 0}, + {"/parenright", 051, 0}, + {"/asterisk", 052, 0}, + {"/plus", 053, 0}, + {"/comma", 054, 0}, + {"/hyphen", 055, 0}, + {"/period", 056, 0}, + {"/slash", 057, 0}, + + {"/zero", 060, 0}, + {"/one", 061, 0}, + {"/two", 062, 0}, + {"/three", 063, 0}, + {"/four", 064, 0}, + {"/five", 065, 0}, + {"/six", 066, 0}, + {"/seven", 067, 0}, + + {"/eight", 070, 0}, + {"/nine", 071, 0}, + {"/colon", 072, 0}, + {"/semicolon", 073, 0}, + {"/less", 074, 0}, + {"/equal", 075, 0}, + {"/greater", 076, 0}, + {"/question", 077, 0}, + + {"/at", 0100, 0}, + {"/A", 0101, 0}, + {"/B", 0102, 0}, + {"/C", 0103, 0}, + {"/D", 0104, 0}, + {"/E", 0105, 0}, + {"/F", 0106, 0}, + {"/G", 0107, 0}, + + {"/H", 0110, 0}, + {"/I", 0111, 0}, + {"/J", 0112, 0}, + {"/K", 0113, 0}, + {"/L", 0114, 0}, + {"/M", 0115, 0}, + {"/N", 0116, 0}, + {"/O", 0117, 0}, + + {"/P", 0120, 0}, + {"/Q", 0121, 0}, + {"/R", 0122, 0}, + {"/S", 0123, 0}, + {"/T", 0124, 0}, + {"/U", 0125, 0}, + {"/V", 0126, 0}, + {"/W", 0127, 0}, + + {"/X", 0130, 0}, + {"/Y", 0131, 0}, + {"/Z", 0132, 0}, + {"/bracketleft", 0133, 0}, + {"/backslash", 0134, 0}, + {"/bracketright", 0135, 0}, + {"/asciicircum", 0136, 0}, + {"/underscore", 0137, 0}, + + {"/quoteleft", 0140, 0}, + {"/a", 0141, 0}, + {"/b", 0142, 0}, + {"/c", 0143, 0}, + {"/d", 0144, 0}, + {"/e", 0145, 0}, + {"/f", 0146, 0}, + {"/g", 0147, 0}, + + {"/h", 0150, 0}, + {"/i", 0151, 0}, + {"/j", 0152, 0}, + {"/k", 0153, 0}, + {"/l", 0154, 0}, + {"/m", 0155, 0}, + {"/n", 0156, 0}, + {"/o", 0157, 0}, + + {"/p", 0160, 0}, + {"/q", 0161, 0}, + {"/r", 0162, 0}, + {"/s", 0163, 0}, + {"/t", 0164, 0}, + {"/u", 0165, 0}, + {"/v", 0166, 0}, + {"/w", 0167, 0}, + + {"/x", 0170, 0}, + {"/y", 0171, 0}, + {"/z", 0172, 0}, + {"/braceleft", 0173, 0}, + {"/bar", 0174, 0}, + {"/braceright", 0175, 0}, + {"/asciitilde", 0176, 0}, + {"/", 0177, 0}, /* nonstandard defs */ - "/quotedblleft", 0200, 0, - "/quotedblright", 0201, 0, - "/quotedblbase", 0202, 0, - "/quotesinglbase", 0203, 0, - "/guilsinglleft", 0204, 0, - "/guilsinglright", 0205, 0, - "/endash", 0206, 0, - "/dagger", 0207, 0, - - "/daggerdbl", 0210, 0, - "/trademark", 0211, 0, - "/bullet", 0212, 0, - "/perthousand", 0213, 0, - "/Lslash", 0214, 0, - "/OE", 0215, 0, - "/lslash", 0216, 0, - "/oe", 0217, 0, + {"/quotedblleft", 0200, 0}, + {"/quotedblright", 0201, 0}, + {"/quotedblbase", 0202, 0}, + {"/quotesinglbase", 0203, 0}, + {"/guilsinglleft", 0204, 0}, + {"/guilsinglright", 0205, 0}, + {"/endash", 0206, 0}, + {"/dagger", 0207, 0}, + + {"/daggerdbl", 0210, 0}, + {"/trademark", 0211, 0}, + {"/bullet", 0212, 0}, + {"/perthousand", 0213, 0}, + {"/Lslash", 0214, 0}, + {"/OE", 0215, 0}, + {"/lslash", 0216, 0}, + {"/oe", 0217, 0}, /* endnonstandard defs */ - "/dotlessi", 0220, 0, - "/grave", 0221, 0, - "/acute", 0222, 0, - "/circumflex", 0223, 0, - "/tilde", 0224, 0, - "/", 0225, 0, - "/breve", 0226, 0, - "/dotaccent", 0227, 0, - - "/", 0230, 0, - "/", 0231, 0, - "/ring", 0232, 0, - "/", 0233, 0, - "/", 0234, 0, - "/hungarumlaut", 0235, 0, - "/ogonek", 0236, 0, - "/caron", 0237, 0, - - "/", 0240, 0, - "/exclamdown", 0241, 0, - "/cent", 0242, 0, - "/sterling", 0243, 0, - "/florin", 0244, 0, - "/yen", 0245, 0, - "/brokenbar", 0246, 0, - "/section", 0247, 0, - - "/dieresis", 0250, 0, - "/copyright", 0251, 0, - "/ordfeminine", 0252, 0, - "/guillemotleft", 0253, 0, - "/logicalnot", 0254, 0, - "/hyphen", 0255, 0, - "/registered", 0256, 0, - "/macron", 0257, 0, - - "/degree", 0260, 0, - "/plusminus", 0261, 0, - "/twosuperior", 0262, 0, - "/threesuperior", 0263, 0, - "/acute", 0264, 0, - "/mu", 0265, 0, - "/paragraph", 0266, 0, - "/periodcentered", 0267, 0, - - "/cedilla", 0270, 0, - "/onesuperior", 0271, 0, - "/ordmasculine", 0272, 0, - "/guillemotright", 0273, 0, - "/onequarter", 0274, 0, - "/onehalf", 0275, 0, - "/threequarters", 0276, 0, - "/questiondown", 0277, 0, - - "/Agrave", 0300, 0, - "/Aacute", 0301, 0, - "/Acircumflex", 0302, 0, - "/Atilde", 0303, 0, - "/Adieresis", 0304, 0, - "/Aring", 0305, 0, - "/AE", 0306, 0, - "/Ccedilla", 0307, 0, - - "/Egrave", 0310, 0, - "/Eacute", 0311, 0, - "/Ecircumflex", 0312, 0, - "/Edieresis", 0313, 0, - "/Igrave", 0314, 0, - "/Iacute", 0315, 0, - "/Icircumflex", 0316, 0, - "/Idieresis", 0317, 0, - - "/Eth", 0320, 0, - "/Ntilde", 0321, 0, - "/Ograve", 0322, 0, - "/Oacute", 0323, 0, - "/Ocircumflex", 0324, 0, - "/Otilde", 0325, 0, - "/Odieresis", 0326, 0, - "/multiply", 0327, 0, - - "/Oslash", 0330, 0, - "/Ugrave", 0331, 0, - "/Uacute", 0332, 0, - "/Ucircumflex", 0333, 0, - "/Udieresis", 0334, 0, - "/Yacute", 0335, 0, - "/Thorn", 0336, 0, - "/germandbls", 0337, 0, - - "/agrave", 0340, 0, - "/aacute", 0341, 0, - "/acircumflex", 0342, 0, - "/atilde", 0343, 0, - "/adieresis", 0344, 0, - "/aring", 0345, 0, - "/ae", 0346, 0, - "/ccedilla", 0347, 0, - - "/egrave", 0350, 0, - "/eacute", 0351, 0, - "/ecircumflex", 0352, 0, - "/edieresis", 0353, 0, - "/igrave", 0354, 0, - "/iacute", 0355, 0, - "/icircumflex", 0356, 0, - "/idieresis", 0357, 0, - - "/eth", 0360, 0, - "/ntilde", 0361, 0, - "/ograve", 0362, 0, - "/oacute", 0363, 0, - "/ocircumflex", 0364, 0, - "/otilde", 0365, 0, - "/odieresis", 0366, 0, - "/divide", 0367, 0, - - "/oslash", 0370, 0, - "/ugrave", 0371, 0, - "/uacute", 0372, 0, - "/ucircumflex", 0373, 0, - "/udieresis", 0374, 0, - "/yacute", 0375, 0, - "/thorn", 0376, 0, - "/ydieresis", 0377, 0, + {"/dotlessi", 0220, 0}, + {"/grave", 0221, 0}, + {"/acute", 0222, 0}, + {"/circumflex", 0223, 0}, + {"/tilde", 0224, 0}, + {"/", 0225, 0}, + {"/breve", 0226, 0}, + {"/dotaccent", 0227, 0}, + + {"/", 0230, 0}, + {"/", 0231, 0}, + {"/ring", 0232, 0}, + {"/", 0233, 0}, + {"/", 0234, 0}, + {"/hungarumlaut", 0235, 0}, + {"/ogonek", 0236, 0}, + {"/caron", 0237, 0}, + + {"/", 0240, 0}, + {"/exclamdown", 0241, 0}, + {"/cent", 0242, 0}, + {"/sterling", 0243, 0}, + {"/florin", 0244, 0}, + {"/yen", 0245, 0}, + {"/brokenbar", 0246, 0}, + {"/section", 0247, 0}, + + {"/dieresis", 0250, 0}, + {"/copyright", 0251, 0}, + {"/ordfeminine", 0252, 0}, + {"/guillemotleft", 0253, 0}, + {"/logicalnot", 0254, 0}, + {"/hyphen", 0255, 0}, + {"/registered", 0256, 0}, + {"/macron", 0257, 0}, + + {"/degree", 0260, 0}, + {"/plusminus", 0261, 0}, + {"/twosuperior", 0262, 0}, + {"/threesuperior", 0263, 0}, + {"/acute", 0264, 0}, + {"/mu", 0265, 0}, + {"/paragraph", 0266, 0}, + {"/periodcentered", 0267, 0}, + + {"/cedilla", 0270, 0}, + {"/onesuperior", 0271, 0}, + {"/ordmasculine", 0272, 0}, + {"/guillemotright", 0273, 0}, + {"/onequarter", 0274, 0}, + {"/onehalf", 0275, 0}, + {"/threequarters", 0276, 0}, + {"/questiondown", 0277, 0}, + + {"/Agrave", 0300, 0}, + {"/Aacute", 0301, 0}, + {"/Acircumflex", 0302, 0}, + {"/Atilde", 0303, 0}, + {"/Adieresis", 0304, 0}, + {"/Aring", 0305, 0}, + {"/AE", 0306, 0}, + {"/Ccedilla", 0307, 0}, + + {"/Egrave", 0310, 0}, + {"/Eacute", 0311, 0}, + {"/Ecircumflex", 0312, 0}, + {"/Edieresis", 0313, 0}, + {"/Igrave", 0314, 0}, + {"/Iacute", 0315, 0}, + {"/Icircumflex", 0316, 0}, + {"/Idieresis", 0317, 0}, + + {"/Eth", 0320, 0}, + {"/Ntilde", 0321, 0}, + {"/Ograve", 0322, 0}, + {"/Oacute", 0323, 0}, + {"/Ocircumflex", 0324, 0}, + {"/Otilde", 0325, 0}, + {"/Odieresis", 0326, 0}, + {"/multiply", 0327, 0}, + + {"/Oslash", 0330, 0}, + {"/Ugrave", 0331, 0}, + {"/Uacute", 0332, 0}, + {"/Ucircumflex",0333, 0}, + {"/Udieresis", 0334, 0}, + {"/Yacute", 0335, 0}, + {"/Thorn", 0336, 0}, + {"/germandbls", 0337, 0}, + + {"/agrave", 0340, 0}, + {"/aacute", 0341, 0}, + {"/acircumflex",0342, 0}, + {"/atilde", 0343, 0}, + {"/adieresis", 0344, 0}, + {"/aring", 0345, 0}, + {"/ae", 0346, 0}, + {"/ccedilla", 0347, 0}, + + {"/egrave", 0350, 0}, + {"/eacute", 0351, 0}, + {"/ecircumflex", 0352, 0}, + {"/edieresis", 0353, 0}, + {"/igrave", 0354, 0}, + {"/iacute", 0355, 0}, + {"/icircumflex", 0356, 0}, + {"/idieresis", 0357, 0}, + + {"/eth", 0360, 0}, + {"/ntilde", 0361, 0}, + {"/ograve", 0362, 0}, + {"/oacute", 0363, 0}, + {"/ocircumflex",0364, 0}, + {"/otilde", 0365, 0}, + {"/odieresis", 0366, 0}, + {"/divide", 0367, 0}, + + {"/oslash", 0370, 0}, + {"/ugrave", 0371, 0}, + {"/uacute", 0372, 0}, + {"/ucircumflex",0373, 0}, + {"/udieresis", 0374, 0}, + {"/yacute", 0375, 0}, + {"/thorn", 0376, 0}, + {"/ydieresis", 0377, 0}, }; static short STDvsISO [][2] = { - 0341, 0306, /* AE */ - 0351, 0330, /* Oslash */ - 0302, 0222, /* acute */ - 0361, 0346, /* ae */ - 0306, 0226, /* breve */ - 0317, 0237, /* caron */ - 0313, 0270, /* cedilla */ - 0303, 0223, /* circumflex */ - 0250, 0244, /* currency */ - 0310, 0250, /* dieresis */ - 0307, 0227, /* dotaccent */ - 0365, 0220, /* dotlessi */ - 0373, 0337, /* germandbls */ - 0301, 0221, /* grave */ - 0315, 0235, /* hungarumlaut */ - 0055, 0255, /* hyphen */ - 0305, 0257, /* macron */ - 0316, 0236, /* ogenek */ - 0343, 0252, /* ordfeminine */ - 0353, 0272, /* ordmasculine */ - 0371, 0370, /* oslash */ - 0264, 0267, /* periodcentered */ - 0312, 0232, /* ring */ - 0304, 0224, /* tilde */ + {0341, 0306}, /* AE */ + {0351, 0330}, /* Oslash */ + {0302, 0222}, /* acute */ + {0361, 0346}, /* ae */ + {0306, 0226}, /* breve */ + {0317, 0237}, /* caron */ + {0313, 0270}, /* cedilla */ + {0303, 0223}, /* circumflex */ + {0250, 0244}, /* currency */ + {0310, 0250}, /* dieresis */ + {0307, 0227}, /* dotaccent */ + {0365, 0220}, /* dotlessi */ + {0373, 0337}, /* germandbls */ + {0301, 0221}, /* grave */ + {0315, 0235}, /* hungarumlaut */ + {0055, 0255}, /* hyphen */ + {0305, 0257}, /* macron */ + {0316, 0236}, /* ogenek */ + {0343, 0252}, /* ordfeminine */ + {0353, 0272}, /* ordmasculine */ + {0371, 0370}, /* oslash */ + {0264, 0267}, /* periodcentered */ + {0312, 0232}, /* ring */ + {0304, 0224}, /* tilde */ }; /* from objfont.c, rest is in lfm_s !!*/ @@ -975,7 +977,7 @@ static void applymat(float mat[][2], float *x, float *y) static void setcharlist(void) { - char *name, found; + char *name; /*found;*/ int i, j; for(i=0; i<NASCII; i++) ISOcharlist[i].prog = -1; @@ -983,11 +985,11 @@ static void setcharlist(void) for(j=0; j<my_nchars; j++) { name = my_charname[j]; if(name) { - found = 0; + /*found = 0;*/ for(i=0; i<NASCII; i++) { if(ISOcharlist[i].name && (strcmp(name,ISOcharlist[i].name) == 0)){ ISOcharlist[i].prog = j; - found = 1; + /*found = 1;*/ } } /*if (found == 0) printf("no match found for: %s\n", name);*/ @@ -1256,10 +1258,10 @@ static void subr0(void) int x1, y1; int x2, y2; int x3, y3; - int xpos, ypos, noise; + int noise; - ypos = pop(); - xpos = pop(); + pop(); /* xpos, unused */ + pop(); /* ypos, unused */ noise = pop(); if(coordpos!=7) { fprintf(stderr,"subr0: bad poop\n"); @@ -1946,7 +1948,7 @@ static VFontData *objfnt_to_vfontdata(objfnt *fnt) chardesc *cd; short *_data, *data; int a, i, count, stop, ready, meet; - short first[2], last[2]; + short first[2]={0,0}, last[2]={0,0}; struct Nurb *nu; struct BezTriple *bezt, *bez2; float scale, dx, dy; @@ -2017,7 +2019,7 @@ static VFontData *objfnt_to_vfontdata(objfnt *fnt) nu->type= CU_BEZIER+CU_2D; nu->pntsu = count; nu->resolu= 8; - nu->flagu= 1; + nu->flagu= CU_CYCLIC; nu->bezt = bezt; stop = 0; |