本文整理汇总了C#中FontSize类的典型用法代码示例。如果您正苦于以下问题:C# FontSize类的具体用法?C# FontSize怎么用?C# FontSize使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FontSize类属于命名空间,在下文中一共展示了FontSize类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateHeadingOneCharStyle
private Style GenerateHeadingOneCharStyle()
{
Style style1 = new Style() { Type = StyleValues.Character, StyleId = HeadingOneCharStyle, CustomStyle = true };
StyleName styleName1 = new StyleName() { Val = "Heading 1 Char" };
BasedOn basedOn1 = new BasedOn() { Val = "DefaultParagraphFont" };
LinkedStyle linkedStyle1 = new LinkedStyle() { Val = "Heading1" };
UIPriority uIPriority1 = new UIPriority() { Val = 9 };
//Rsid rsid1 = new Rsid() { Val = "0013195F" };
StyleRunProperties styleRunProperties1 = new StyleRunProperties();
RunFonts runFonts1 = new RunFonts() { AsciiTheme = ThemeFontValues.MajorHighAnsi, HighAnsiTheme = ThemeFontValues.MajorHighAnsi, EastAsiaTheme = ThemeFontValues.MajorEastAsia, ComplexScriptTheme = ThemeFontValues.MajorBidi };
Color color1 = new Color() { Val = "2E74B5", ThemeColor = ThemeColorValues.Accent1, ThemeShade = "BF" };
FontSize fontSize1 = new FontSize() { Val = "32" };
FontSizeComplexScript fontSizeComplexScript1 = new FontSizeComplexScript() { Val = "32" };
styleRunProperties1.Append(runFonts1);
styleRunProperties1.Append(color1);
styleRunProperties1.Append(fontSize1);
styleRunProperties1.Append(fontSizeComplexScript1);
style1.Append(styleName1);
style1.Append(basedOn1);
style1.Append(linkedStyle1);
style1.Append(uIPriority1);
//style1.Append(rsid1);
style1.Append(styleRunProperties1);
return style1;
}
示例2: AddNewTextbox
public TextBox AddNewTextbox(FloatRectangle relativeRectangle, FontSize fontSize = FontSize.Normal)
{
TextBox textBox = new TextBox(Graphics, fontSize);
_drawables.Add(textBox);
textBox.BoundingBox = Graphics.Window.ToAbsoluteRectangle(relativeRectangle);
return textBox;
}
示例3: Text
public Text(FontSize size, string text, Vector3 color, BMFont.Justification justification = BMFont.Justification.Left)
{
this.Justification = justification;
this.font = FontFromSize(size);
this.String = text;
this.Color = color;
}
示例4: AddNewListMenu
public ListMenu AddNewListMenu(string title, FloatRectangle relativeRectangle, FontSize fontSize = FontSize.Normal)
{
ListMenu menu = new ListMenu(title, Graphics, fontSize);
menu.BoundingBox = Graphics.Window.ToAbsoluteRectangle(relativeRectangle);
AddMenu(menu);
return menu;
}
示例5: CSSFontSizeProperty
internal CSSFontSizeProperty()
: base(PropertyNames.FontSize)
{
_mode = FontSize.Medium;
_size = null;
_inherited = true;
}
示例6: VisitFontSize
public override object VisitFontSize(FontSize fontSize)
{
if (fontSize.Size <= 0)
{
Report.AddError(fontSize.Position, "Style attribute 'fontsize' must have a value greater than 0.");
}
return null;
}
示例7: Add
public static bool Add(string key, FontSize size, SpriteFont font)
{
if (_fonts.Keys.Contains(key + size)) return false;
_fonts.Add(key + size, font);
return true;
}
示例8: TimeAnnouncerEntity
public TimeAnnouncerEntity(AnnouncerEnded endFunction, float height, float time, FontSize size)
: base(endFunction, height)
{
endAlarm = new Alarm(time, TweenType.OneShot, new AlarmFinished(FinishAnnouncer));
AddTween(endAlarm, true);
text = new Text("", size);
}
示例9: Text
public Text(string text, FontSize size)
{
this.text = text;
this.alignType = AlignType.Left;
ChangeFont(size);
this.origin = new Vector2();
this.scale = new Vector2(1, 1);
this.angle = 0;
this.flipping = SpriteEffects.None;
this.tintColor = Color.White;
}
示例10: FontUnit
public FontUnit(FontSize type)
{
if(!Enum.IsDefined(typeof(FontSize), type))
throw new ArgumentException();
this.type = type;
if(this.type == FontSize.AsUnit)
{
val = Unit.Point(10);
} else
{
val = Unit.Empty;
}
}
示例11: CreateFont
private static Font CreateFont(string fontName = "Calibri", int fontSize = 11, bool bold = false, string color = "00000000")
{
var ft = new Font();
var ftn = new FontName();
ftn.Val = StringValue.FromString(fontName);
var ftsz = new FontSize();
ftsz.Val = DoubleValue.FromDouble(fontSize);
ft.FontName = ftn;
ft.FontSize = ftsz;
ft.Bold = new Bold { Val = bold };
ft.Color = new Color { Rgb = HexBinaryValue.FromString(color) };
return ft;
}
示例12: FontUnit
public FontUnit(System.Web.UI.WebControls.Unit value)
{
this.type = FontSize.NotSet;
if (!value.IsEmpty)
{
this.type = FontSize.AsUnit;
this.value = value;
}
else
{
this.value = System.Web.UI.WebControls.Unit.Empty;
}
}
示例13: FontUnit
public FontUnit (FontSize type)
{
int t = (int) type;
if (t < 0 || t > (int)FontSize.XXLarge)
throw new ArgumentOutOfRangeException ("type");
this.type = type;
if (type == FontSize.AsUnit)
unit = new Unit (10, UnitType.Point);
else
unit = Unit.Empty;
}
示例14: GetFont
public static SpriteFont GetFont(string fontName, FontSize fontSize, bool bold, bool italic)
{
FontGroup f = null;
if (fonts.TryGetValue(fontName, out f))
{
return f.GetSpriteFont(fontSize, bold, italic);
}
else
{
// Log an error and return the default font
DebugLog.Log("Could not find requested font " + fontName + ", using default instead.");
return Render.GetBasicFont();
}
}
示例15: FontFromSize
public static BMFont FontFromSize(FontSize font)
{
switch (font)
{
case FontSize._24pt: return BMFont.LoadFont("media/font24.fnt");
case FontSize._32pt: return BMFont.LoadFont("media/font32.fnt");
case FontSize._48pt: return BMFont.LoadFont("media/font48.fnt");
case FontSize._54pt: return BMFont.LoadFont("media/font54.fnt");
case FontSize._72pt: return BMFont.LoadFont("media/font72.fnt");
default:
Console.WriteLine("Unknown font " + font + " requested.");
return BMFont.LoadFont("fonts/font12.fnt");
}
}