本文整理汇总了C#中PdfSharp.Drawing.XMatrix.SkewPrepend方法的典型用法代码示例。如果您正苦于以下问题:C# XMatrix.SkewPrepend方法的具体用法?C# XMatrix.SkewPrepend怎么用?C# XMatrix.SkewPrepend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdfSharp.Drawing.XMatrix
的用法示例。
在下文中一共展示了XMatrix.SkewPrepend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteGlyphs
/// <summary>
/// Writes a Glyphs to the content stream.
/// </summary>
private void WriteGlyphs(Glyphs glyphs)
{
WriteSaveState("begin Glyphs", glyphs.Name);
// Transform also affects clipping and opacity mask
bool transformed = glyphs.RenderTransform != null;
if (transformed)
WriteRenderTransform(glyphs.RenderTransform);
bool clipped = glyphs.Clip != null;
if (clipped)
WriteClip(glyphs.Clip);
if (glyphs.Opacity < 1)
MultiplyOpacity(glyphs.Opacity);
if (glyphs.OpacityMask != null)
WriteOpacityMask(glyphs.OpacityMask);
XMatrix textMatrix = new XMatrix();
textMatrix.TranslatePrepend(glyphs.OriginX, glyphs.OriginY);
glyphs.OriginX = glyphs.OriginY = 0; // HACK: do not change model
double emSize = glyphs.FontRenderingEmSize;
textMatrix.ScalePrepend(glyphs.FontRenderingEmSize);
glyphs.FontRenderingEmSize = 1; // HACK: do not change model
bool boldSimulation = (glyphs.StyleSimulations & StyleSimulations.BoldSimulation) == StyleSimulations.BoldSimulation;
// just a draft...
if (boldSimulation)
{
boldSimulation = true;
// draw black stroke if it is not a solid color brush
XColor color = XColor.FromArgb(0, 0, 0);
if (glyphs.Fill is SolidColorBrush)
{
SolidColorBrush brush = glyphs.Fill as SolidColorBrush;
color = brush.Color;
}
WriteLiteral(String.Format(CultureInfo.InvariantCulture, "{0:0.###} {1:0.###} {2:0.###} RG\n", color.R / 255.0, color.G / 255.0, color.B / 255.0));
WriteLiteral("{0:0.###} w\n", emSize / 50);
}
if ((glyphs.StyleSimulations & StyleSimulations.ItalicSimulation) == StyleSimulations.ItalicSimulation)
{
textMatrix.SkewPrepend(-20, 0);
}
XForm xform = null;
XImage ximage = null;
RealizeFill(glyphs.Fill, ref xform, ref ximage);
RealizeFont(glyphs);
if (boldSimulation)
WriteLiteral("2 Tr\n", 1);
double x = glyphs.OriginX;
double y = glyphs.OriginY;
//switch (format.Alignment)
//{
// case XStringAlignment.Near:
// // nothing to do
// break;
// case XStringAlignment.Center:
// x += (rect.Width - width) / 2;
// break;
// case XStringAlignment.Far:
// x += rect.Width - width;
// break;
//}
PdfFont realizedFont = this.graphicsState.realizedFont;
Debug.Assert(realizedFont != null);
realizedFont.AddChars(glyphs.UnicodeString);
OpenTypeDescriptor descriptor = realizedFont.FontDescriptor.descriptor;
//if (bold && !descriptor.IsBoldFace)
//{
// // TODO: emulate bold by thicker outline
//}
//if (italic && !descriptor.IsBoldFace)
//{
// // TODO: emulate italic by shearing transformation
//}
#if true
string s2 = "";
//.........这里部分代码省略.........