public MessageComponent( string text, string fontName, Vector2 position, Vector2 size, Color color, FontFlags fontFlags) { this.Text = text; this.Position = position; this.FontFace = fontName; this.Size = size; this.Color = color; this.Flags = fontFlags; }
/// <summary> /// </summary> /// <param name="text"></param> /// <param name="fontName"></param> /// <param name="position"></param> /// <param name="size"></param> /// <param name="color"></param> /// <param name="fontFlags"></param> public void AddElement( string text, string fontName, Vector2 position, Vector2 size, Color color, FontFlags fontFlags) { var element = new AMessageComponent(text, fontName, position, size, color, fontFlags) { Parent = this, ComponentType = "DrawText_Font" }; this.components.Add(this.elements, element); this.elements++; }
public static SanitizedHtmlString GetDefaultUserFontStyle(UserContext userContext) { UserOptions userOptions = userContext.UserOptions; SanitizingStringBuilder <OwaHtml> sanitizingStringBuilder = new SanitizingStringBuilder <OwaHtml>(256); FontFlags composeFontFlags = userOptions.ComposeFontFlags; sanitizingStringBuilder.Append("direction: "); sanitizingStringBuilder.Append(userContext.IsRtl ? "rtl" : "ltr"); sanitizingStringBuilder.Append <char>(';'); sanitizingStringBuilder.Append("font-family: "); sanitizingStringBuilder.Append <SanitizedJScriptString>(new SanitizedJScriptString(userOptions.ComposeFontName)); sanitizingStringBuilder.Append <char>(';'); sanitizingStringBuilder.Append("color: "); sanitizingStringBuilder.Append <SanitizedJScriptString>(new SanitizedJScriptString(userOptions.ComposeFontColor)); sanitizingStringBuilder.Append <char>(';'); sanitizingStringBuilder.Append("font-size: "); sanitizingStringBuilder.Append(ReplyForwardUtilities.fontSizeMapping[userOptions.ComposeFontSize]); sanitizingStringBuilder.Append <char>(';'); return(sanitizingStringBuilder.ToSanitizedString <SanitizedHtmlString>()); }
public static void Info(string Content, Color color, int Index, int x = 0, FontFlags flags = FontFlags.Outline | FontFlags.AntiAlias) { Vector2 coords = Variables.ESP_Notifier_StartingCoords; coords.Y += 12 * Index; coords.X += x; Drawing.DrawText(Content, coords, color, flags); /*public static void Info(Hero target, string text, int Index, Color color, FontFlags flags = FontFlags.Outline | FontFlags.AntiAlias, int x = 0) { Vector2 coords = Drawing.WorldToScreen(target.Position); coords.Y -= 80; coords.Y += 12 * Index; coords.X += 75 + x; Drawing.DrawText(text, coords, color, flags); }*/ }
public static void Info(Hero target, string text, int Index, Color color, FontFlags flags = FontFlags.Outline | FontFlags.AntiAlias, int x = 0) { Vector2 coords = Drawing.WorldToScreen(target.Position); coords.Y -= 80; coords.Y += 12 * Index; coords.X += 75 + x; Drawing.DrawText(text, coords, color, flags); }
public static void Info(string Content, Color color, int Index, int x = 0, FontFlags flags = FontFlags.Outline | FontFlags.AntiAlias) { Vector2 coords = Variables.ESP_Notifier_StartingCoords; coords.Y += 12 * Index; coords.X += x; Drawing.DrawText(Content, coords, color, flags); /*public static void Info(Hero target, string text, int Index, Color color, FontFlags flags = FontFlags.Outline | FontFlags.AntiAlias, int x = 0) * { * Vector2 coords = Drawing.WorldToScreen(target.Position); * coords.Y -= 80; * coords.Y += 12 * Index; * coords.X += 75 + x; * Drawing.DrawText(text, coords, color, flags); * }*/ }
public FontDescriptor(NameToken name, FontFlags flags) { FontName = name; Flags = flags; }
public void DrawCharacter(GlyphImage image, int clipX, int clipY, int clipWidth, int clipHeight, int charCode, int altCharCode, FontFlags glyphType) { Glyph glyph; if (!GetCharGlyph(charCode, glyphType, out glyph)) { // No Glyph available for this charCode, try to use the alternate char. charCode = altCharCode; if (!GetCharGlyph(charCode, glyphType, out glyph)) { return; } } if (glyph.w <= 0 || glyph.h <= 0) { return; } if (((glyph.flags & (int)FontFlags.BMP_OVERLAY) != (int)FontFlags.BMP_H_ROWS) && ((glyph.flags & (int)FontFlags.BMP_OVERLAY) != (int)FontFlags.BMP_V_ROWS)) { return; } int bitPtr = (int)(glyph.ptr * 8); int numberPixels = glyph.w * glyph.h; int pixelIndex = 0; int x = image.xPos64 >> 6; int y = image.yPos64 >> 6; // Negative means don't clip on that side. if (clipX < 0) { clipX = 0; } if (clipY < 0) { clipY = 0; } if (clipWidth < 0) { clipWidth = 8192; } if (clipHeight < 0) { clipHeight = 8192; } while (pixelIndex < numberPixels && bitPtr + 8 < fontDataSize * 8) { // This is some kind of nibble based RLE compression. int nibble = consumeBits(4, fontData, ref bitPtr); int count; int value = 0; if (nibble < 8) { value = consumeBits(4, fontData, ref bitPtr); count = nibble + 1; } else { count = 16 - nibble; } for (int i = 0; i < count && pixelIndex < numberPixels; i++) { if (nibble >= 8) { value = consumeBits(4, fontData, ref bitPtr); } int xx, yy; if (((FontFlags)glyph.flags & FontFlags.BMP_OVERLAY) == FontFlags.BMP_H_ROWS) { xx = pixelIndex % glyph.w; yy = pixelIndex / glyph.w; } else { xx = pixelIndex / glyph.h; yy = pixelIndex % glyph.h; } int pixelX = x + xx; int pixelY = y + yy; if (pixelX >= clipX && pixelX < clipX + clipWidth && pixelY >= clipY && pixelY < clipY + clipHeight) { // 4-bit color value int pixelColor = value; switch ((FontPixelFormat)(int)image.pixelFormat) { case FontPixelFormat.PSP_FONT_PIXELFORMAT_8: { // 8-bit color value pixelColor |= pixelColor << 4; break; } case FontPixelFormat.PSP_FONT_PIXELFORMAT_24: { // 24-bit color value pixelColor |= pixelColor << 4; pixelColor |= pixelColor << 8; pixelColor |= pixelColor << 8; break; } case FontPixelFormat.PSP_FONT_PIXELFORMAT_32: { // 32-bit color value pixelColor |= pixelColor << 4; pixelColor |= pixelColor << 8; pixelColor |= pixelColor << 16; break; } case FontPixelFormat.PSP_FONT_PIXELFORMAT_4: case FontPixelFormat.PSP_FONT_PIXELFORMAT_4_REV: { break; } default: { //ERROR_LOG_REPORT(SCEFONT, "Unhandled font pixel format: %d", (int)image.pixelFormat); break; } } SetFontPixel(image.bufferPtr, image.bytesPerLine, image.bufWidth, image.bufHeight, pixelX, pixelY, pixelColor, image.pixelFormat); } pixelIndex++; } } //gpu.InvalidateCache(image.bufferPtr, image.bytesPerLine * image.bufHeight, GPU_INVALIDATE_SAFE); }
public bool GetCharInfo(int charCode, out PGFCharInfo charInfo, int altCharCode, FontFlags glyphType = FontFlags.CHARGLYPH) { Glyph glyph; charInfo = new PGFCharInfo(); if (!GetCharGlyph(charCode, glyphType, out glyph)) { if (charCode < firstGlyph) { // Character not in font, return zeroed charInfo as on real PSP. return(false); } if (!GetCharGlyph(altCharCode, glyphType, out glyph)) { return(false); } } charInfo.bitmapWidth = (uint)glyph.w; charInfo.bitmapHeight = (uint)glyph.h; charInfo.bitmapLeft = (uint)glyph.left; charInfo.bitmapTop = (uint)glyph.top; charInfo.sfp26Width = (uint)glyph.dimensionWidth; charInfo.sfp26Height = (uint)glyph.dimensionHeight; charInfo.sfp26Ascender = glyph.yAdjustH; // Font y goes upwards. If top is 10 and height is 11, the descender is approx. -1 (below 0.) charInfo.sfp26Descender = charInfo.sfp26Ascender - (int)charInfo.sfp26Height; charInfo.sfp26BearingHX = glyph.xAdjustH; charInfo.sfp26BearingHY = glyph.yAdjustH; charInfo.sfp26BearingVX = glyph.xAdjustV; charInfo.sfp26BearingVY = glyph.yAdjustV; charInfo.sfp26AdvanceH = glyph.advanceH; charInfo.sfp26AdvanceV = glyph.advanceV; charInfo.shadowFlags = (short)glyph.shadowFlags; charInfo.shadowId = (short)glyph.shadowID; return(true); }
public FontDescriptor(CosName name, FontFlags flags) { FontName = name; Flags = flags; }
/// <summary> /// </summary> /// <param name="text"></param> /// <param name="fontName"></param> /// <param name="position"></param> /// <param name="size"></param> /// <param name="color"></param> /// <param name="fontFlags"></param> public AMessageComponent( string text, string fontName, Vector2 position, Vector2 size, Color color, FontFlags fontFlags) { this.Text = text; this.Position = position; this.FontFace = fontName; this.Size = size; this.Color = color; this.Flags = fontFlags; }
/// <summary> /// </summary> /// <param name="text"></param> /// <param name="position"></param> /// <param name="color"></param> /// <param name="fontFlags"></param> public AMessageComponent(string text, Vector2 position, Color color, FontFlags fontFlags) { this.Text = text; this.Position = position; this.Color = color; this.Flags = fontFlags; }
public Style WithFontFlags(FontFlags fontFlags) => new Style(styleKind: StyleKind, color: Color, background: Background, fontFlags: fontFlags);
public Style(StyleKind styleKind, Color?color = null, Color?background = null, FontFlags fontFlags = 0) { StyleKind = styleKind; Color = color; Background = background; FontFlags = fontFlags; }