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; }
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; }
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, }; }
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; }
//[HlePspNotImplemented] public int sceFontFindOptimumFont(FontLibraryHandle FontLibraryHandle, FontStyle* FontStylePointer, uint* ErrorCode) { return sceFontFindFont(FontLibraryHandle, FontStylePointer, ErrorCode); }