コード例 #1
0
ファイル: sceLibFont.Library.cs プロジェクト: soywiz/cspspemu
 public int sceFontFindFont(FontLibrary FontLibrary, FontStyle* FontStylePointer, uint* ErrorCode)
 {
     var FontRegistry = FontLibrary.FontRegistryList.OrderByDescending(Entry => FontStyle.GetScoreCompare(Entry.FontStyle, *FontStylePointer)).First();
     var FontIndex = FontLibrary.FontRegistryList.IndexOf(FontRegistry);
     *ErrorCode = 0;
     return FontIndex;
 }
コード例 #2
0
ファイル: sceLibFont.Library.cs プロジェクト: soywiz/cspspemu
 public int sceFontGetFontList(FontLibrary FontLibrary, FontStyle* FontStylesPointer, int MaximumNumberOfFontsToGet)
 {
     int NumberOfFontsReturned = Math.Min(MaximumNumberOfFontsToGet, FontLibrary.FontRegistryList.Count);
     for (int n = 0; n < NumberOfFontsReturned; n++)
     {
         FontStylesPointer[n] = FontLibrary.FontRegistryList[n].FontStyle;
     }
     return NumberOfFontsReturned;
 }
コード例 #3
0
ファイル: sceLibFont.Utils.cs プロジェクト: shin527/cspspemu
			public FontRegistryEntry(int HorizontalSize, int VerticalSize, int HorizontalResolution,
				int VerticalResolution, int ExtraAttributes, int Weight,
				FamilyEnum Family, StyleEnum StyleStyle, ushort StyleSub, LanguageEnum Language,
				ushort Region, ushort Country, String FileName,
				String Name, uint Expire, int ShadowOption)
			{
				this.ExtraAttributes = ExtraAttributes;
				this.ShadowOption = ShadowOption;
				this.FontStyle = new FontStyle()
				{
					Size = new HorizontalVerticalFloat() { Horizontal = HorizontalSize, Vertical = VerticalSize, },
					Resolution = new HorizontalVerticalFloat() { Horizontal = HorizontalResolution, Vertical = VerticalResolution, },
					Weight = Weight,
					Family = Family,
					StyleStyle = StyleStyle,
					StyleSub = StyleSub,
					Language = Language,
					Region = Region,
					Country = Country,
					FileName = FileName,
					Name = Name,
					Expire = Expire,
				};
			}
コード例 #4
0
ファイル: PGF.Structs.cs プロジェクト: e-COS/cspspemu
        public static float GetScoreCompare(FontStyle Left, FontStyle Right)
        {
            float Score = 0.0f;
            if (Left.Size == Right.Size) Score++;
            if (Left.Resolution == Right.Resolution) Score++;

            return Score;
        }
コード例 #5
0
		//[HlePspNotImplemented]
		public int sceFontFindOptimumFont(FontLibraryHandle FontLibraryHandle, FontStyle* FontStylePointer, uint* ErrorCode)
		{
			return sceFontFindFont(FontLibraryHandle, FontStylePointer, ErrorCode);
		}