summaryrefslogtreecommitdiff
path: root/src/FreeType
diff options
context:
space:
mode:
Diffstat (limited to 'src/FreeType')
-rw-r--r--src/FreeType/ft.h2
-rw-r--r--src/FreeType/ftenc.c2
-rw-r--r--src/FreeType/ftfuncs.c64
-rw-r--r--src/FreeType/ftfuncs.h3
-rw-r--r--src/FreeType/ftsystem.c2
-rw-r--r--src/FreeType/fttools.c2
-rw-r--r--src/FreeType/xttcap.c9
-rw-r--r--src/FreeType/xttcap.h2
8 files changed, 53 insertions, 33 deletions
diff --git a/src/FreeType/ft.h b/src/FreeType/ft.h
index b597457..91c8d42 100644
--- a/src/FreeType/ft.h
+++ b/src/FreeType/ft.h
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* $XFree86: xc/lib/font/FreeType/ft.h,v 1.23 2003/10/19 18:53:49 dawes Exp $ */
+/* $XFree86: xc/lib/font/FreeType/ft.h,v 1.22 2003/06/08 15:41:13 herrb Exp $ */
#ifndef _FT_H_
#define _FT_H_
diff --git a/src/FreeType/ftenc.c b/src/FreeType/ftenc.c
index a3b02b9..d45dc32 100644
--- a/src/FreeType/ftenc.c
+++ b/src/FreeType/ftenc.c
@@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* $XFree86: xc/lib/font/FreeType/ftenc.c,v 1.25 2003/11/20 22:36:34 dawes Exp $ */
+/* $XFree86: xc/lib/font/FreeType/ftenc.c,v 1.24 2003/10/19 18:53:49 dawes Exp $ */
#ifndef FONTMODULE
#include <string.h>
diff --git a/src/FreeType/ftfuncs.c b/src/FreeType/ftfuncs.c
index 556a511..81682e4 100644
--- a/src/FreeType/ftfuncs.c
+++ b/src/FreeType/ftfuncs.c
@@ -1327,7 +1327,7 @@ FreeTypeUnloadXFont(FontPtr pFont)
static int
FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
- char *fontname, int rawAverageWidth)
+ char *fontname, int rawAverageWidth, Bool font_properties)
{
int i, j, maxprops;
char *sp, *ep, val[MAXFONTNAMELEN], *vp;
@@ -1376,9 +1376,11 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
maxprops=
1 + /* NAME */
(xlfdProps ? 14 : 0) + /* from XLFD */
- 8 +
- (os2 ? 6 : 0) +
- (post || t1info? 3 : 0) +
+ 5 +
+ ( !face->bitmap ? 3 : 0 ) + /* raw_av,raw_asc,raw_dec */
+ ( font_properties ? 2 : 0 ) + /* asc,dec */
+ ( (font_properties && os2) ? 6 : 0 ) +
+ ( (font_properties && (post || t1info)) ? 3 : 0 ) +
2; /* type */
info->props = (FontPropPtr)xalloc(maxprops * sizeof(FontPropRec));
@@ -1444,29 +1446,41 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
}
}
+ info->props[i].name = MakeAtom("RAW_PIXEL_SIZE", 14, TRUE);
+ info->props[i].value = 1000;
+ i++;
+
+ info->props[i].name = MakeAtom("RAW_POINT_SIZE", 14, TRUE);
+ info->props[i].value = (long)(72270.0 / (double)vals->y + .5);
+ i++;
+
if(!face->bitmap) {
info->props[i].name = MakeAtom("RAW_AVERAGE_WIDTH", 17, TRUE);
info->props[i].value = rawAverageWidth;
i++;
}
- info->props[i].name = MakeAtom("FONT_ASCENT", 11, TRUE);
- info->props[i].value = info->fontAscent;
- i++;
+ if ( font_properties ) {
+ info->props[i].name = MakeAtom("FONT_ASCENT", 11, TRUE);
+ info->props[i].value = info->fontAscent;
+ i++;
+ }
if(!face->bitmap) {
- info->props[i].name = MakeAtom("RAW_ASCENT", 15, TRUE);
+ info->props[i].name = MakeAtom("RAW_ASCENT", 10, TRUE);
info->props[i].value =
((double)face->face->ascender/(double)upm*1000.0);
i++;
}
- info->props[i].name = MakeAtom("FONT_DESCENT", 12, TRUE);
- info->props[i].value = info->fontDescent;
- i++;
+ if ( font_properties ) {
+ info->props[i].name = MakeAtom("FONT_DESCENT", 12, TRUE);
+ info->props[i].value = info->fontDescent;
+ i++;
+ }
if(!face->bitmap) {
- info->props[i].name = MakeAtom("RAW_DESCENT", 16, TRUE);
+ info->props[i].name = MakeAtom("RAW_DESCENT", 11, TRUE);
info->props[i].value =
-((double)face->face->descender/(double)upm*1000.0);
i++;
@@ -1541,7 +1555,7 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
/* In what follows, we assume the matrix is diagonal. In the rare
case when it is not, the values will be somewhat wrong. */
- if(os2) {
+ if( font_properties && os2 ) {
info->props[i].name = MakeAtom("SUBSCRIPT_SIZE",14,TRUE);
info->props[i].value =
TRANSFORM_FUNITS_Y(os2->ySubscriptYSize);
@@ -1568,7 +1582,7 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
i++;
}
- if(post || t1info) {
+ if( font_properties && (post || t1info) ) {
int underlinePosition, underlineThickness;
/* Raw underlineposition counts upwards,
@@ -1909,8 +1923,8 @@ restrict_code_range_by_str(int count,unsigned short *refFirstCol,
static int
FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
char **dynStrRealFileName, char **dynStrFTFileName,
- struct TTCapInfo *ret, int *face_number,
- FT_Int32 *load_flags, int *spacing, char **dynStrTTCapCodeRange )
+ struct TTCapInfo *ret, int *face_number, FT_Int32 *load_flags,
+ int *spacing, Bool *font_properties, char **dynStrTTCapCodeRange )
{
int result = Successful;
SDynPropRecValList listPropRecVal;
@@ -1920,6 +1934,7 @@ FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
Bool alwaysEmbeddedBitmap = False;
int pixel = vals->pixel;
+ *font_properties=True;
*dynStrRealFileName=NULL;
*dynStrFTFileName=NULL;
*dynStrTTCapCodeRange=NULL;
@@ -2404,6 +2419,13 @@ FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
}
}
+ if (SPropRecValList_search_record(&listPropRecVal,
+ &contRecValue,
+ "FontProperties")) {
+ /* Set or Reset the Flag of FontProperties */
+ *font_properties=SPropContainer_value_bool(contRecValue);
+ }
+
ret->force_c_scale_b_box_width *= ret->scaleBBoxWidth;
ret->force_c_scale_b_box_height *= ret->scaleBBoxHeight;
@@ -2870,7 +2892,7 @@ FreeTypeLoadXFont(char *fileName,
long rawWidth = 0, rawAverageWidth = 0;
int upm, minLsb, maxRsb, ascent, descent, width, averageWidth;
double scale, base_width, base_height;
- Bool orig_is_matrix_unit;
+ Bool orig_is_matrix_unit, font_properties;
int face_number, ttcap_spacing;
struct TTCapInfo tmp_ttcap;
struct TTCapInfo *ins_ttcap;
@@ -2890,7 +2912,7 @@ FreeTypeLoadXFont(char *fileName,
&dynStrRealFileName, &dynStrFTFileName,
&tmp_ttcap, &face_number,
&load_flags, &ttcap_spacing,
- &dynStrTTCapCodeRange);
+ &font_properties, &dynStrTTCapCodeRange);
if ( xrc != Successful ) {
goto quit;
}
@@ -3319,8 +3341,12 @@ FreeTypeLoadXFont(char *fileName,
/* set info */
if( info ){
+ /*
info->fontAscent = ascent;
info->fontDescent = descent;
+ */
+ info->fontAscent = info->maxbounds.ascent;
+ info->fontDescent = info->maxbounds.descent;
/* Glyph metrics are accurate */
info->inkMetrics=1;
@@ -3349,7 +3375,7 @@ FreeTypeLoadXFont(char *fileName,
if(info) {
xrc = FreeTypeAddProperties(font, vals, info, entry->name.name,
- rawAverageWidth);
+ rawAverageWidth, font_properties);
if (xrc != Successful) {
goto quit;
}
diff --git a/src/FreeType/ftfuncs.h b/src/FreeType/ftfuncs.h
index dadb546..6777667 100644
--- a/src/FreeType/ftfuncs.h
+++ b/src/FreeType/ftfuncs.h
@@ -174,8 +174,7 @@ static void FreeTypeFreeXFont(FontPtr pFont, int freeProps);
static void FreeTypeUnloadXFont(FontPtr pFont);
static int
FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
- char *fontname,
- int rawAverageWidth);
+ char *fontname, int rawAverageWidth, Bool font_properties);
static int FreeTypeFontGetGlyph(unsigned code, int flags, CharInfoPtr *g, FTFontPtr font);
static int
FreeTypeLoadFont(FTFontPtr font, FontInfoPtr info, FTFacePtr face,
diff --git a/src/FreeType/ftsystem.c b/src/FreeType/ftsystem.c
index 300ff5a..2378364 100644
--- a/src/FreeType/ftsystem.c
+++ b/src/FreeType/ftsystem.c
@@ -18,7 +18,7 @@
/***************************************************************************/
/* Modified for XFree86 */
-/* $XFree86: xc/lib/font/FreeType/ftsystem.c,v 1.3 2002/10/01 00:02:10 alanh Exp $ */
+/* $XFree86$ */
/*************************************************************************/
/* */
diff --git a/src/FreeType/fttools.c b/src/FreeType/fttools.c
index 33c3e26..2cde03a 100644
--- a/src/FreeType/fttools.c
+++ b/src/FreeType/fttools.c
@@ -21,7 +21,7 @@
THE SOFTWARE.
*/
-/* $XFree86: xc/lib/font/FreeType/fttools.c,v 1.7 2003/11/20 22:36:37 dawes Exp $ */
+/* $XFree86: xc/lib/font/FreeType/fttools.c,v 1.6 2003/06/08 15:41:13 herrb Exp $ */
#include "fontmisc.h"
#ifndef FONTMODULE
diff --git a/src/FreeType/xttcap.c b/src/FreeType/xttcap.c
index 8f1c599..1e2d566 100644
--- a/src/FreeType/xttcap.c
+++ b/src/FreeType/xttcap.c
@@ -102,7 +102,7 @@ static SPropertyRecord const validRecords[] =
{ "FaceNumber", eRecTypeString },
{ "AutoItalic", eRecTypeDouble },
{ "DoubleStrike", eRecTypeString },
- { "ForceProportional", eRecTypeBool },
+ { "FontProperties", eRecTypeBool },
{ "ForceSpacing", eRecTypeString },
{ "ScaleBBoxWidth", eRecTypeString },
{ "ScaleWidth", eRecTypeDouble },
@@ -126,13 +126,8 @@ static struct {
} const correspondRelations[] = {
{ "fn", "FaceNumber" },
{ "ai", "AutoItalic" },
-#if True /* obsoleted - pointed out by mrt ->->-> */
- { "ab", "DoubleStrike" },
-#endif /* <-<-<- obsoleted */
{ "ds", "DoubleStrike" },
-#if True /* obsoleted ->->-> */
- { "fp", "ForceProportional" },
-#endif /* <-<-<- obsoleted */
+ { "fp", "FontProperties" },
{ "fs", "ForceSpacing" },
{ "bw", "ScaleBBoxWidth" },
{ "sw", "ScaleWidth" },
diff --git a/src/FreeType/xttcap.h b/src/FreeType/xttcap.h
index 2b4826b..33c224f 100644
--- a/src/FreeType/xttcap.h
+++ b/src/FreeType/xttcap.h
@@ -30,7 +30,7 @@
Notice===
*/
-/* $XFree86: xc/lib/font/FreeType/xttcap.h,v 1.1 2003/10/19 18:53:50 dawes Exp $ */
+/* $XFree86: xc/extras/X-TrueType/xttcap.h,v 1.2 2001/08/01 00:44:33 tsi Exp $ */
#ifndef _XTTCAP_H_
#define _XTTCAP_H_ (1)