本文整理汇总了C#中Glyph类的典型用法代码示例。如果您正苦于以下问题:C# Glyph类的具体用法?C# Glyph怎么用?C# Glyph使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Glyph类属于命名空间,在下文中一共展示了Glyph类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PreviewChanges
public Solution PreviewChanges(
string title,
string helpString,
string description,
string topLevelName,
Glyph topLevelGlyph,
Solution newSolution,
Solution oldSolution,
bool showCheckBoxes = true)
{
var engine = new PreviewEngine(
title,
helpString,
description,
topLevelName,
topLevelGlyph,
newSolution,
oldSolution,
_componentModel,
_imageService,
showCheckBoxes);
_previewChanges.PreviewChanges(engine);
engine.CloseWorkspace();
return engine.FinalSolution;
}
示例2: FileSystemCompletionHelper
public FileSystemCompletionHelper(
CompletionListProvider completionProvider,
TextSpan textChangeSpan,
ICurrentWorkingDirectoryDiscoveryService fileSystemDiscoveryService,
Glyph folderGlyph,
Glyph fileGlyph,
ImmutableArray<string> searchPaths,
IEnumerable<string> allowableExtensions,
Func<string, bool> exclude = null,
CompletionItemRules itemRules = null)
{
Debug.Assert(searchPaths.All(path => PathUtilities.IsAbsolute(path)));
_completionProvider = completionProvider;
_textChangeSpan = textChangeSpan;
_searchPaths = searchPaths;
_allowableExtensions = allowableExtensions.Select(e => e.ToLowerInvariant()).ToSet();
_fileSystemDiscoveryService = fileSystemDiscoveryService;
_folderGlyph = folderGlyph;
_fileGlyph = fileGlyph;
_exclude = exclude;
_itemRules = itemRules;
_lazyGetDrives = new Lazy<string[]>(() =>
IOUtilities.PerformIO(Directory.GetLogicalDrives, SpecializedCollections.EmptyArray<string>()));
}
示例3: SymbolCompletionItem
public SymbolCompletionItem(
CompletionListProvider completionProvider,
string displayText,
string insertionText,
string filterText,
TextSpan filterSpan,
int position,
List<ISymbol> symbols,
string sortText,
AbstractSyntaxContext context,
Glyph glyph,
bool preselect = false,
SupportedPlatformData supportedPlatforms = null,
CompletionItemRules rules = null)
: base(completionProvider, displayText, filterSpan,
descriptionFactory: null, glyph: glyph,
sortText: sortText, filterText: filterText, preselect: preselect, showsWarningIcon: supportedPlatforms != null, rules: rules,
filters: GetFilters(symbols))
{
this.InsertionText = insertionText;
this.Position = position;
this.Symbols = symbols;
this.Context = context;
_supportedPlatforms = supportedPlatforms;
}
示例4: Create
public static CompletionItem Create(
string displayText,
TextSpan span,
Glyph? glyph,
DeclarationModifiers modifiers,
int line,
ISymbol symbol,
SyntaxToken token,
int descriptionPosition,
CompletionItemRules rules)
{
var props = ImmutableDictionary<string, string>.Empty
.Add("Line", line.ToString())
.Add("Modifiers", modifiers.ToString())
.Add("TokenSpanEnd", token.Span.End.ToString());
return SymbolCompletionItem.Create(
displayText: displayText,
span: span,
symbol: symbol,
glyph: glyph,
descriptionPosition: descriptionPosition,
properties: props,
rules: rules);
}
示例5: Rasterize
public Bitmap Rasterize(Glyph glyph, TextQuality quality)
{
EnsureSurfaceSize(ref glyph_surface, ref glyph_renderer, glyph.Font);
SetTextRenderingOptions(glyph_renderer, glyph.Font, quality);
RectangleF r2 = new RectangleF();
glyph_renderer.Clear(Color.Transparent);
glyph_renderer.DrawString(glyph.Character.ToString(), glyph.Font, Brushes.White, Point.Empty, //new Point(glyph_surface.Width, 0),
glyph.Font.Style == FontStyle.Italic ? load_glyph_string_format : load_glyph_string_format_tight);
r2 = FindEdges(glyph_surface, true);
//if ((default_string_format.FormatFlags & StringFormatFlags.DirectionRightToLeft) != 0)
//{
// glyph_renderer.DrawString(glyph.Character.ToString(), glyph.Font, Brushes.White, Point.Empty, //new Point(glyph_surface.Width, 0),
// load_glyph_string_format);//glyph.Font.Style == FontStyle.Italic ? load_glyph_string_format : default_string_format);
// r2 = FindEdges(glyph_surface, true);
//}
//else
//{
// glyph_renderer.DrawString(glyph.Character.ToString(), glyph.Font, Brushes.White, Point.Empty,
// load_glyph_string_format_tight); //glyph.Font.Style == FontStyle.Italic ? load_glyph_string_format : default_string_format);
// r2 = FindEdges(glyph_surface, false);
//}
return glyph_surface.Clone(r2, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
}
示例6: Crop
public static void Crop(Glyph glyph)
{
// Crop the top.
while ((glyph.Subrect.Height > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Y, glyph.Subrect.Width, 1)))
{
glyph.Subrect.Y++;
glyph.Subrect.Height--;
glyph.YOffset++;
}
// Crop the bottom.
while ((glyph.Subrect.Height > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Bottom - 1, glyph.Subrect.Width, 1)))
{
glyph.Subrect.Height--;
}
// Crop the left.
while ((glyph.Subrect.Width > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Y, 1, glyph.Subrect.Height)))
{
glyph.Subrect.X++;
glyph.Subrect.Width--;
glyph.XOffset++;
}
// Crop the right.
while ((glyph.Subrect.Width > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.Right - 1, glyph.Subrect.Y, 1, glyph.Subrect.Height)))
{
glyph.Subrect.Width--;
}
}
示例7: PreviewEngine
public PreviewEngine(
string title,
string helpString,
string description,
string topLevelItemName,
Glyph topLevelGlyph,
Solution newSolution,
Solution oldSolution,
IComponentModel componentModel,
IVsImageService2 imageService,
bool showCheckBoxes = true)
{
_topLevelName = topLevelItemName;
_topLevelGlyph = topLevelGlyph;
_title = title;
_helpString = helpString;
_description = description;
_newSolution = newSolution.WithMergedLinkedFileChangesAsync(oldSolution, cancellationToken: CancellationToken.None).Result;
_oldSolution = oldSolution;
_diffSelector = componentModel.GetService<ITextDifferencingSelectorService>();
_editorFactory = componentModel.GetService<IVsEditorAdaptersFactoryService>();
_componentModel = componentModel;
this.ShowCheckBoxes = showCheckBoxes;
_imageService = imageService;
}
示例8: SymbolGlyphDeferredContent
public SymbolGlyphDeferredContent(Glyph glyph, IGlyphService glyphService)
{
Contract.ThrowIfNull(glyphService);
_glyph = glyph;
_glyphService = glyphService;
}
示例9: Create
public static CompletionItem Create(
string displayText,
ISymbol symbol,
int contextPosition = -1,
string sortText = null,
string insertionText = null,
Glyph? glyph = null,
string filterText = null,
int? matchPriority = null,
SupportedPlatformData supportedPlatforms = null,
ImmutableDictionary<string, string> properties = null,
CompletionItemRules rules = null)
{
return Create(
displayText: displayText,
symbols: ImmutableArray.Create(symbol),
contextPosition: contextPosition,
sortText: sortText,
insertionText: insertionText,
glyph: glyph,
filterText: filterText,
matchPriority: matchPriority.GetValueOrDefault(),
supportedPlatforms: supportedPlatforms,
properties: properties,
rules: rules);
}
示例10: Create
public static CompletionItem Create(
string displayText,
TextSpan span,
ISymbol symbol,
int contextPosition = -1,
int descriptionPosition = -1,
string sortText = null,
string insertionText = null,
Glyph? glyph = null,
string filterText = null,
bool preselect = false,
SupportedPlatformData supportedPlatforms = null,
bool isArgumentName = false,
ImmutableDictionary<string, string> properties = null,
CompletionItemRules rules = null)
{
return Create(
displayText: displayText,
span: span,
symbols: ImmutableArray.Create(symbol),
contextPosition: contextPosition,
descriptionPosition: descriptionPosition,
sortText: sortText,
insertionText: insertionText,
glyph: glyph,
filterText: filterText,
preselect: preselect,
supportedPlatforms: supportedPlatforms,
isArgumentName: isArgumentName,
properties: properties,
rules: rules);
}
示例11: ReadGlyph
/// <summary>
/// Reads a glyph description from the specified offset.
/// </summary>
public Glyph ReadGlyph(int glyphIndex) {
FontFileStream stream = reader.Stream;
// Offset from beginning of font file
uint fileOffset = glyfEntry.Offset + loca[glyphIndex];
long length = GetGlyphLength(glyphIndex);
Glyph glyph = new Glyph(reader.IndexMappings.Map(glyphIndex));
if (length != 0) {
byte[] glyphData = new byte[length];
// Read glyph description into byte array
stream.Position = fileOffset;
stream.Read(glyphData, 0, glyphData.Length);
glyph.SetGlyphData(glyphData);
FontFileStream glyphStream = new FontFileStream(glyphData);
// This fields dictates whether the glyph is a simple or composite glyph
bool compositeGlyph = (glyphStream.ReadShort() < 0);
// Skip font bounding box
glyphStream.Skip(PrimitiveSizes.Short*4);
if (compositeGlyph) {
ReadCompositeGlyph(glyphStream, glyph);
}
}
return glyph;
}
示例12: RenderGlyph
public static Surface RenderGlyph (Fnt font, Glyph g, byte[] palette, int offset)
{
byte[] buf = new byte[g.Width * g.Height * 4];
int i = 0;
for (int y = g.Height - 1; y >= 0; y--) {
for (int x = g.Width - 1; x >= 0; x--) {
if (g.Bitmap[y,x] == 0)
buf [i + 0] = 0;
else if (g.Bitmap[y,x] == 1)
buf [i + 0] = 255;
else
buf [i + 0] = 128;
buf[i + 1] = palette[ (g.Bitmap[y,x] + offset) * 3 + 2];
buf[i + 2] = palette[ (g.Bitmap[y,x] + offset) * 3 + 1];
buf[i + 3] = palette[ (g.Bitmap[y,x] + offset) * 3 ];
if (buf[i+1] == 252 && buf[i+2] == 0 && buf[i+3] == 252)
buf[i + 0] = 0;
i += 4;
}
}
return CreateSurfaceFromRGBAData (buf, (ushort)g.Width, (ushort)g.Height, 32, g.Width * 4);
}
示例13: CSharpCompletionItem
public CSharpCompletionItem(
Workspace workspace,
CompletionListProvider completionProvider,
string displayText,
TextSpan filterSpan,
Func<CancellationToken, Task<ImmutableArray<SymbolDisplayPart>>> descriptionFactory,
Glyph? glyph,
string sortText = null,
string filterText = null,
bool preselect = false,
bool isBuilder = false,
bool showsWarningIcon = false,
bool shouldFormatOnCommit = false)
: base(completionProvider,
displayText,
filterSpan,
descriptionFactory,
glyph,
sortText,
filterText,
preselect,
isBuilder,
showsWarningIcon,
shouldFormatOnCommit)
{
Contract.ThrowIfNull(workspace);
this.Workspace = workspace;
}
示例14: QuickInfoModel
private QuickInfoModel(SemanticModel semanticModel, TextSpan span, Glyph glyph, SymbolMarkup markup, string documentation)
{
SemanticModel = semanticModel;
Span = span;
Glyph = glyph;
Markup = markup;
Documentation = documentation;
}
示例15: EditorNavigationTarget
public EditorNavigationTarget(string name, SnapshotSpan span, SnapshotSpan seek, Glyph icon, ImageSource glyph)
{
Name = name;
Span = span;
Seek = seek;
Icon = icon;
Glyph = glyph;
}