本文整理汇总了C#中FontSize类的典型用法代码示例。如果您正苦于以下问题:C# FontSize类的具体用法?C# FontSize怎么用?C# FontSize使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FontSize类属于命名空间,在下文中一共展示了FontSize类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:FerHenrique,项目名称:Owl,代码行数:29,代码来源:StyleCreator.cs
示例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;
}
开发者ID:nicojans,项目名称:FinalQuest,代码行数:7,代码来源:GUI.cs
示例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;
}
开发者ID:giawa,项目名称:ee2015presentation,代码行数:7,代码来源:Text.cs
示例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;
}
开发者ID:nicojans,项目名称:FinalQuest,代码行数:7,代码来源:GUI.cs
示例5: CSSFontSizeProperty
internal CSSFontSizeProperty()
: base(PropertyNames.FontSize)
{
_mode = FontSize.Medium;
_size = null;
_inherited = true;
}
开发者ID:jogibear9988,项目名称:AngleSharp,代码行数:7,代码来源:CSSFontSizeProperty.cs
示例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;
}
开发者ID:javachengwc,项目名称:many-ql,代码行数:8,代码来源:StyleAttributeChecker.cs
示例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;
}
开发者ID:HaKDMoDz,项目名称:armadillo,代码行数:8,代码来源:FontManager.cs
示例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);
}
开发者ID:amidos2006,项目名称:CleanEmUp,代码行数:8,代码来源:TimeAnnouncerEntity.cs
示例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;
}
开发者ID:amidos2006,项目名称:CleanEmUp,代码行数:11,代码来源:Text.cs
示例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;
}
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:13,代码来源:FontUnit.cs
示例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;
}
开发者ID:kuritka,项目名称:MarketLoader,代码行数:13,代码来源:StyleSheet.FontCollection.cs
示例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;
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:FontUnit.cs
示例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;
}
开发者ID:nobled,项目名称:mono,代码行数:14,代码来源:FontUnit.cs
示例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();
}
}
开发者ID:oconnerj,项目名称:TyrantsQuest,代码行数:14,代码来源:FontBox.cs
示例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");
}
}
开发者ID:giawa,项目名称:ee2015presentation,代码行数:14,代码来源:Text.cs
示例16: CreateFont
public static UInt32Value CreateFont(Stylesheet styleSheet, string fontName, double? fontSize, bool isBold, System.Drawing.Color foreColor)
{
Font font = new Font();
if (!string.IsNullOrEmpty(fontName))
{
FontName name = new FontName()
{
Val = fontName
};
font.Append(name);
}
if (fontSize.HasValue)
{
FontSize size = new FontSize()
{
Val = fontSize.Value
};
font.Append(size);
}
if (isBold == true)
{
Bold bold = new Bold();
font.Append(bold);
}
Color color = new Color()
{
Rgb = new HexBinaryValue()
{
Value =
System.Drawing.ColorTranslator.ToHtml(
System.Drawing.Color.FromArgb(
foreColor.A,
foreColor.R,
foreColor.G,
foreColor.B)).Replace("#", "")
}
};
font.Append(color);
styleSheet.Fonts.Append(font);
UInt32Value result = styleSheet.Fonts.Count;
styleSheet.Fonts.Count++;
return result;
}
开发者ID:foufure,项目名称:ExcelDynamicReaderWriter,代码行数:48,代码来源:Utility.cs
示例17: FontUnit
/// <summary>
/// Initializes a new instance of the class with a FontSize.
/// </summary>
/// <param name="type">The font size.</param>
public FontUnit(FontSize type)
{
if (type < FontSize.NotSet || type > FontSize.XXLarge)
{
throw new ArgumentOutOfRangeException("type");
}
_type = type;
if (_type == FontSize.AsUnit)
{
_value = Unit.Point(10);
}
else
{
_value = Unit.Empty;
}
}
开发者ID:dfr0,项目名称:moon,代码行数:20,代码来源:FontUnit.cs
示例18: AddAlphaRow
public Paragraph AddAlphaRow()
{
var paragraph1 = new Paragraph {RsidParagraphMarkRevision = "005205ED", RsidParagraphAddition = "00A01149", RsidParagraphProperties = "005205ED", RsidRunAdditionDefault = "00E7001C"};
var paragraphProperties1 = new ParagraphProperties();
var spacingBetweenLines1 = new SpacingBetweenLines {After = "60", Line = "240", LineRule = LineSpacingRuleValues.Auto};
var justification1 = new Justification {Val = JustificationValues.Center};
var paragraphMarkRunProperties1 = new ParagraphMarkRunProperties();
var runFonts1 = new RunFonts {ComplexScriptTheme = ThemeFontValues.MinorHighAnsi};
var bold1 = new Bold();
var fontSize1 = new FontSize {Val = "32"};
var fontSizeComplexScript1 = new FontSizeComplexScript {Val = "32"};
paragraphMarkRunProperties1.Append(runFonts1);
paragraphMarkRunProperties1.Append(bold1);
paragraphMarkRunProperties1.Append(fontSize1);
paragraphMarkRunProperties1.Append(fontSizeComplexScript1);
paragraphProperties1.Append(new KeepNext());
paragraphProperties1.Append(spacingBetweenLines1);
paragraphProperties1.Append(justification1);
paragraphProperties1.Append(paragraphMarkRunProperties1);
var run1 = new Run {RsidRunProperties = "005205ED"};
var runProperties1 = new RunProperties();
var runFonts2 = new RunFonts {ComplexScriptTheme = ThemeFontValues.MinorHighAnsi};
var bold2 = new Bold();
var fontSize2 = new FontSize {Val = "32"};
var fontSizeComplexScript2 = new FontSizeComplexScript {Val = "32"};
runProperties1.Append(runFonts2);
runProperties1.Append(bold2);
runProperties1.Append(fontSize2);
runProperties1.Append(fontSizeComplexScript2);
var text1 = new Text();
text1.Text = FamilyName.Substring(0, 1);
run1.Append(runProperties1);
run1.Append(text1);
paragraph1.Append(paragraphProperties1);
paragraph1.Append(run1);
return paragraph1;
}
开发者ID:stevesloka,项目名称:bvcms,代码行数:46,代码来源:CompactRow.cs
示例19: Start
private DrawingColor drawingColorComp;//drawing color
//Use this for Initialization
void Start ()
{
fontSizeType = FontSizeType.PEN;
fontSize = FontSize.MEDIUM;
selectedTool = SelectedTool.PEN;
lineColor = new Color (0, 147, 68, 100) / 255.0f;
prevColor = lineColor;
drawingMaterial = GameObject.Find ("green (Drawing Level)").GetComponent<DrawingColor> ().drawingMaterial;
previousMaterial = drawingMaterial;
if (middleCam == null) {
middleCam = GameObject.FindGameObjectWithTag ("MiddleCam").GetComponent<Camera> ();//setting up middle camera reference
}
if (drawResizerOb == null) {
drawResizerOb = GameObject.Find ("Draw-Resizer (Drawing Level)");
}
if (toolsAnimator == null) {
toolsAnimator = GameObject.Find ("Tools").GetComponent<Animator> ();
}
if (brushObFollowTarget == null) {
brushObFollowTarget = GameObject.Find ("brush (Drawing Level)").GetComponent<FollowTarget> ();
}
if (deleteObFollowTarget == null) {
deleteObFollowTarget = GameObject.Find ("eraser (Drawing Level)").GetComponent<FollowTarget> ();
}
if (penObFollowTarget == null) {
penObFollowTarget = GameObject.Find ("pencil (Drawing Level)").GetComponent<FollowTarget> ();
}
if (colorsWheelControllerComp == null) {
colorsWheelControllerComp = GameObject.Find ("ColorsWheel (Drawing Level)").GetComponent<ColorsWheelController> ();
}
drawResizerBackground = drawResizerOb.transform.Find ("draw-resizer-background (Drawing Level)").gameObject;
SetDrawResizerColor ();
SetFontSize ();
}
开发者ID:finian826,项目名称:Unity-A-Z,代码行数:45,代码来源:OnScreenDrawing.cs
示例20: IsValid
/// <summary>
/// Determines if the given value represents a valid state of this property.
/// </summary>
/// <param name="value">The state that should be used.</param>
/// <returns>True if the state is valid, otherwise false.</returns>
protected override Boolean IsValid(CSSValue value)
{
//TODO
//UNITLESS in QUIRKSMODE
FontSize? size;
var calc = value.AsCalc();
if (calc != null)
{
_size = calc;
_mode = FontSize.Custom;
}
else if ((size = value.ToFontSize()).HasValue)
{
_size = null;
_mode = size.Value;
}
else if (value != CSSValue.Inherit)
return false;
return true;
}
开发者ID:jogibear9988,项目名称:AngleSharp,代码行数:27,代码来源:CSSFontSizeProperty.cs
注:本文中的FontSize类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论