コード例 #1
0
ファイル: Font.cs プロジェクト: randomize/unity3d-ttftext
        float vectorScale_; // (point_size * resolution)/ (72 * face->units_per_em)

        #endregion Fields

        #region Constructors

        public Font(string path, float height, int dpi)
        {
            lib = FTLibrary.Instance;
            dpi_=dpi;

            int code = FT.FT_New_Face(lib.Handle, path, 0, out face_);
            FT.CheckError(code);

            FT.FT_FaceRec facerec = FT.HandleToRecord<FT.FT_FaceRec>(face_);

            familyName_ = facerec.family_name;
            styleName_ = facerec.style_name;

            face_has_kerning_ = ((facerec.face_flags & FT.FT_FACE_FLAG_KERNING) != 0);
            face_units_per_EM_ = facerec.units_per_EM;
            face_height_ = facerec.height;

            //Console.WriteLine("new FONT = unit-per-em=" + face_units_per_EM_);
            //setCharSize(pointsize);

            setCharHeight(height);
        }
コード例 #2
0
        float vectorScale_; // (point_size * resolution)/ (72 * face->units_per_em)


        public Font(string path, float height, uint dpi)
        {
            lib  = FTLibrary.Instance;
            dpi_ = dpi;

            int code = FT.FT_New_Face(lib.Handle, path, 0, out face_);

            FT.CheckError(code);

            FT.FT_FaceRec facerec = FT.HandleToRecord <FT.FT_FaceRec>(face_);

            familyName_ = facerec.family_name;
            styleName_  = facerec.style_name;

            face_has_kerning_  = ((facerec.face_flags & FT.FT_FACE_FLAG_KERNING) != 0);
            face_units_per_EM_ = facerec.units_per_EM;
            face_height_       = facerec.height;

            //Console.WriteLine("new FONT = unit-per-em=" + face_units_per_EM_);
            //setCharSize(pointsize);

            setCharHeight(height);
        }
コード例 #3
0
ファイル: FTLibrary.cs プロジェクト: r618/unity3d-ttftext
 // static singleton constructor
 static FTLibrary()
 {
     instance = new FTLibrary();
 }
コード例 #4
0
 // static singleton constructor
 static FTLibrary()
 {
     instance = new FTLibrary();
 }