예제 #1
0
 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
 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
			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
        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);
		}