当前位置: 首页>>代码示例>>C#>>正文


C# Configuration.IsFontSizeNull方法代码示例

本文整理汇总了C#中Configuration.IsFontSizeNull方法的典型用法代码示例。如果您正苦于以下问题:C# Configuration.IsFontSizeNull方法的具体用法?C# Configuration.IsFontSizeNull怎么用?C# Configuration.IsFontSizeNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Configuration的用法示例。


在下文中一共展示了Configuration.IsFontSizeNull方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreatePdfText

	private void CreatePdfText(PdfContentByte content, Configuration.PrintTemplateContentRow row, string text)
	{
		CreatePdfBox(content, row);

		float originX = Convert.ToSingle(row.OriginX) * PointsPerInch;
		float originY = Convert.ToSingle(row.OriginY) * PointsPerInch;
		float width = Convert.ToSingle(row.Width) * PointsPerInch;
		float height = Convert.ToSingle(row.Height) * PointsPerInch;

		string fontFamily = "Helvetica";
		int textAlign = PdfContentByte.ALIGN_CENTER;
		float fontSize = 12;
		int textStyle = iTextSharp.text.Font.NORMAL;
		bool textWrap = false;

		int columnAlign = Element.ALIGN_CENTER;

		if (!row.IsTextWrapNull())
		{
			textWrap = row.TextWrap == 1;
		}

		if (!row.IsFontFamilyNull())
		{
			fontFamily = row.FontFamily;
		}

		if (!row.IsFontBoldNull())
		{
			if (row.FontBold == 1)
			{
				if (textWrap)
				{
					textStyle = Font.BOLD;
				}
				else
				{
					fontFamily += "-Bold";
				}
			}
		}

		if (!row.IsFontSizeNull())
		{
			fontSize = Convert.ToSingle(row.FontSize);
		}

		BaseFont baseFont = BaseFont.CreateFont(fontFamily, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);

		if (textWrap)
		{
			if (!row.IsTextAlignNull())
			{
				switch (row.TextAlign)
				{
					case "left":
						columnAlign = Element.ALIGN_LEFT;
						break;
					case "right":
						columnAlign = Element.ALIGN_RIGHT;
						break;
				}
			}

			Font font = new Font(baseFont, fontSize, textStyle);
			content.SetRGBColorFill(0, 0, 0);

			float leading = fontSize * 1.2f;

			ColumnText column = new ColumnText(content);
			column.SetSimpleColumn(originX, originY, originX + width, originY + height, leading, columnAlign);
			column.AddText(new Phrase(leading, text, font));
			column.Go();
		}
		else
		{
			originX += width / 2;

			if (!row.IsTextAlignNull())
			{
				switch (row.TextAlign)
				{
					case "left":
						textAlign = PdfContentByte.ALIGN_LEFT;
						originX -= width / 2;
						break;
					case "right":
						textAlign = PdfContentByte.ALIGN_RIGHT;
						originX += width / 2;
						break;
				}
			}

			content.BeginText();
			content.SetFontAndSize(baseFont, fontSize);
			content.SetRGBColorFill(0, 0, 0);
			content.ShowTextAligned(textAlign, text, originX, originY, 0);
			content.EndText();
		}
	}
开发者ID:ClaireBrill,项目名称:GPV,代码行数:100,代码来源:PdfMap.cs

示例2: LegendProperties

    public LegendProperties(Configuration.PrintTemplateContentRow row)
    {
      OriginX = Convert.ToSingle(row.OriginX) * PointsPerInch;
      OriginY = Convert.ToSingle(row.OriginY) * PointsPerInch;
      Width = Convert.ToSingle(row.Width) * PointsPerInch;
      Height = Convert.ToSingle(row.Height) * PointsPerInch;

      string fontFamily = row.IsFontFamilyNull() ? "Helvetica" : row.FontFamily;
      FontSize = row.IsFontSizeNull() ? 12 : Convert.ToSingle(row.FontSize);

      if (!row.IsFontBoldNull() && row.FontBold == 1)
      {
        fontFamily += "-Bold";
      }

      BaseFont = BaseFont.CreateFont(fontFamily, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);

      SwatchHeight = FontSize;
      SwatchWidth = FontSize * 1.4f;
      LayerSpacing = FontSize * 0.5f;
      ClassSpacing = FontSize * 0.15f;
      ColumnSpacing = FontSize * 1.4f;

      ColumnWidth = !row.IsLegendColumnWidthNull() ? Convert.ToSingle(row.LegendColumnWidth) * PointsPerInch :
          FontSize * 12 + SwatchWidth;

      NumColumns = Convert.ToInt32(Math.Floor((Width + ColumnSpacing) / (ColumnWidth + ColumnSpacing)));
    }
开发者ID:ClaireBrill,项目名称:GPV,代码行数:28,代码来源:PdfMap.cs

示例3: CreatePdfTabData

  private void CreatePdfTabData(PdfContentByte content, Configuration.PrintTemplateContentRow row)
  {
    CreatePdfBox(content, row);

    float originX = Convert.ToSingle(row.OriginX) * PointsPerInch;
    float originY = Convert.ToSingle(row.OriginY) * PointsPerInch;
    float width = Convert.ToSingle(row.Width) * PointsPerInch;
    float height = Convert.ToSingle(row.Height) * PointsPerInch;

    string fontFamily = row.IsFontFamilyNull() ? "Helvetica" : row.FontFamily;
    float fontSize = row.IsFontSizeNull() ? 12 : Convert.ToSingle(row.FontSize);

    BaseFont normalFont = BaseFont.CreateFont(fontFamily, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
    BaseFont boldFont = BaseFont.CreateFont(fontFamily + "-Bold", BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
  }
开发者ID:ClaireBrill,项目名称:GPV,代码行数:15,代码来源:PdfMap.cs


注:本文中的Configuration.IsFontSizeNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。