"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Plugins/Pdf/PDFWriter/FreeTypeFaceWrapper.h" between
TeXmacs-1.99.4-src.tar.gz and TeXmacs-1.99.5-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

FreeTypeFaceWrapper.h  (TeXmacs-1.99.4-src):FreeTypeFaceWrapper.h  (TeXmacs-1.99.5-src)
skipping to change at line 46 skipping to change at line 46
typedef std::pair<bool,FT_Short> BoolAndFTShort; typedef std::pair<bool,FT_Short> BoolAndFTShort;
typedef std::list<unsigned int> UIntList; typedef std::list<unsigned int> UIntList;
typedef std::list<UIntList> UIntListList; typedef std::list<UIntList> UIntListList;
typedef std::list<std::string> StringList; typedef std::list<std::string> StringList;
typedef std::list<unsigned long> ULongList; typedef std::list<unsigned long> ULongList;
typedef std::list<ULongList> ULongListList; typedef std::list<ULongList> ULongListList;
class FreeTypeFaceWrapper class FreeTypeFaceWrapper
{ {
public: public:
class IOutlineEnumerator;
// first overload - all but type ones. the file path is just given for st orage (later queries may want it) // first overload - all but type ones. the file path is just given for st orage (later queries may want it)
FreeTypeFaceWrapper(FT_Face inFace,const std::string& inFontFilePath,long inFontIndex,bool inDoOwn = true); FreeTypeFaceWrapper(FT_Face inFace,const std::string& inFontFilePath,long inFontIndex,bool inDoOwn = true);
// second overload - type 1, to allow passing pfm file path. do not bothe r // second overload - type 1, to allow passing pfm file path. do not bothe r
// if you don't have a PFM file. no i don't care about the godamn AFM fil e. just the PFM. // if you don't have a PFM file. no i don't care about the godamn AFM fil e. just the PFM.
// if you don't have a PFM i'll manage. again - i don't need the @#$@#$ A FM file. // if you don't have a PFM i'll manage. again - i don't need the @#$@#$ A FM file.
// you see. i need to know if the font is serif, script 'n such. AFM - ev en if there // you see. i need to know if the font is serif, script 'n such. AFM - ev en if there
// does not have that kind of info. so @#$@#$ off. // does not have that kind of info. so @#$@#$ off.
// for any case, i'll check the file extension, and only do something abo ut it if it has a pfm extension // for any case, i'll check the file extension, and only do something abo ut it if it has a pfm extension
FreeTypeFaceWrapper(FT_Face inFace,const std::string& inFontFilePath,cons t std::string& inPFMFilePath,long inFontIndex,bool inDoOwn = true); FreeTypeFaceWrapper(FT_Face inFace,const std::string& inFontFilePath,cons t std::string& inPFMFilePath,long inFontIndex,bool inDoOwn = true);
skipping to change at line 68 skipping to change at line 70
FT_Error DoneFace(); FT_Error DoneFace();
FT_Face operator->(); FT_Face operator->();
operator FT_Face(); operator FT_Face();
bool IsValid(); bool IsValid();
PDFHummus::EStatusCode GetGlyphsForUnicodeText(const ULongList& inUnicode Characters,UIntList& outGlyphs); PDFHummus::EStatusCode GetGlyphsForUnicodeText(const ULongList& inUnicode Characters,UIntList& outGlyphs);
PDFHummus::EStatusCode GetGlyphsForUnicodeText(const ULongListList& inUni codeCharacters,UIntListList& outGlyphs); PDFHummus::EStatusCode GetGlyphsForUnicodeText(const ULongListList& inUni codeCharacters,UIntListList& outGlyphs);
std::string GetPostscriptName();
double GetItalicAngle(); double GetItalicAngle();
BoolAndFTShort GetCapHeight(); // aligned to pdf metrics BoolAndFTShort GetCapHeight(); // aligned to pdf metrics
BoolAndFTShort GetxHeight(); // aligned to pdf metrics BoolAndFTShort GetxHeight(); // aligned to pdf metrics
FT_UShort GetStemV(); // aligned to pdf metrics FT_UShort GetStemV(); // aligned to pdf metrics
EFontStretch GetFontStretch(); EFontStretch GetFontStretch();
FT_UShort GetFontWeight(); FT_UShort GetFontWeight();
// these would be flags for the font as a whole. if subsetting, match to the character set // these would be flags for the font as a whole. if subsetting, match to the character set
unsigned int GetFontFlags(); unsigned int GetFontFlags();
const char* GetTypeString(); const char* GetTypeString();
std::string GetGlyphName(unsigned int inGlyphIndex); std::string GetGlyphName(unsigned int inGlyphIndex, bool safe=false);
FT_Pos GetGlyphWidth(unsigned int inGlyphIndex); FT_Pos GetGlyphWidth(unsigned int inGlyphIndex);
bool GetGlyphOutline(unsigned int inGlyphIndex, IOutlineEnumerator& inEnu merator);
// Create the written font object, matching to write this font in the bes t way. // Create the written font object, matching to write this font in the bes t way.
IWrittenFont* CreateWrittenFontObject(ObjectsContext* inObjectsContext); IWrittenFont* CreateWrittenFontObject(ObjectsContext* inObjectsContext);
// flags determining values // flags determining values
bool IsFixedPitch(); bool IsFixedPitch();
bool IsSerif(); bool IsSerif();
bool IsScript(); bool IsScript();
bool IsItalic(); bool IsItalic();
bool IsForceBold(); bool IsForceBold();
skipping to change at line 107 skipping to change at line 111
// all measurements in this class are already aligned...so no need to ali gn them // all measurements in this class are already aligned...so no need to ali gn them
FT_Short GetInPDFMeasurements(FT_Short inFontMeasurement); FT_Short GetInPDFMeasurements(FT_Short inFontMeasurement);
FT_UShort GetInPDFMeasurements(FT_UShort inFontMeasurement); FT_UShort GetInPDFMeasurements(FT_UShort inFontMeasurement);
FT_Pos GetInPDFMeasurements(FT_Pos inFontMeasurement); FT_Pos GetInPDFMeasurements(FT_Pos inFontMeasurement);
// translate to freetype glyph index. this may not always be the input, as i n the case // translate to freetype glyph index. this may not always be the input, as i n the case
// of type 3 fonts with private encoding. so what actually gets in is the gl yph index // of type 3 fonts with private encoding. so what actually gets in is the gl yph index
// according to hummus // according to hummus
unsigned int GetGlyphIndexInFreeTypeIndexes(unsigned int inGlyphIndex); unsigned int GetGlyphIndexInFreeTypeIndexes(unsigned int inGlyphIndex);
// load glyph, use the freetype load glyph, but add some extra flags that
are common to
// Hummus requirements, which is SPEED SPEED. as i don't normally need re
ndering
// hinting and scaling is always removed. inFlags are added on top of the
default flags
FT_Error LoadGlyph(FT_UInt inGlyphIndex, FT_Int32 inFlags = 0);
private: private:
FT_Face mFace; FT_Face mFace;
IFreeTypeFaceExtender* mFormatParticularWrapper; IFreeTypeFaceExtender* mFormatParticularWrapper;
bool mHaslowercase; bool mHaslowercase;
std::string mFontFilePath; std::string mFontFilePath;
long mFontIndex; long mFontIndex;
std::string mNotDefGlyphName; std::string mNotDefGlyphName;
bool mGlyphIsLoaded;
unsigned int mCurrentGlyph;
bool mDoesOwn; bool mDoesOwn;
BoolAndFTShort GetCapHeightInternal(); BoolAndFTShort GetCapHeightInternal();
BoolAndFTShort GetxHeightInternal(); BoolAndFTShort GetxHeightInternal();
FT_UShort GetStemVInternal(); FT_UShort GetStemVInternal();
std::string GetExtension(const std::string& inFilePath); std::string GetExtension(const std::string& inFilePath);
void SetupFormatSpecificExtender(const std::string& inFilePath, const std ::string& inPFMFilePath); void SetupFormatSpecificExtender(const std::string& inFilePath, const std ::string& inPFMFilePath);
BoolAndFTShort CapHeightFromHHeight(); BoolAndFTShort CapHeightFromHHeight();
BoolAndFTShort XHeightFromLowerXHeight(); BoolAndFTShort XHeightFromLowerXHeight();
BoolAndFTShort GetYBearingForUnicodeChar(unsigned short unicodeCharCode); BoolAndFTShort GetYBearingForUnicodeChar(unsigned short unicodeCharCode);
EFontStretch StretchFromName(); EFontStretch StretchFromName();
FT_UShort WeightFromName(); FT_UShort WeightFromName();
bool IsSymbolic(); bool IsSymbolic();
bool IsDefiningCharsNotInAdobeStandardLatin(); bool IsDefiningCharsNotInAdobeStandardLatin();
void SetupNotDefGlyph(); std::string NotDefGlyphName();
public:
class IOutlineEnumerator {
public:
IOutlineEnumerator(){ mUPM = 0; }
virtual ~IOutlineEnumerator(){};
inline FT_Short UPM() const { return mUPM; } //typically 1000 or
2048
protected:
//in font em units relative to UPM
virtual bool Moveto(FT_Short x, FT_Short y) =0; //ret false to ab
ort
virtual bool Lineto(FT_Short x, FT_Short y) =0;
virtual bool Curveto(FT_Short x1, FT_Short y1, FT_Short x2, FT_Sh
ort y2, FT_Short x3, FT_Short y3) =0;
virtual bool Close() =0;
private:
friend bool FreeTypeFaceWrapper::GetGlyphOutline(unsigned int inG
lyphIndex, IOutlineEnumerator& inEnumerator);
static int outline_moveto(const FT_Vector* to, void *closure);
static int outline_lineto(const FT_Vector* to, void *closure);
static int outline_conicto(const FT_Vector *control, const FT_Vec
tor *to, void *closure);
static int outline_cubicto(const FT_Vector *control1, const FT_Ve
ctor *control2, const FT_Vector *to, void *closure);
void FTBegin(FT_UShort upm);
inline bool FTMoveto(const FT_Vector *to); //rets true if ok
inline bool FTLineto(const FT_Vector *to);
inline bool FTConicto(const FT_Vector *control, const FT_Vector *
to);
inline bool FTCubicto(const FT_Vector *control1, const FT_Vector
*control2, const FT_Vector *to);
void FTEnd();
FT_UShort mUPM; //units per EM
bool mToLastValid;
FT_Vector mToLast;
};
}; };
 End of changes. 7 change blocks. 
2 lines changed or deleted 58 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS