예제 #1
0
        private void UpdateListContainer(ListViewItem item, Character c)
        {
            item.Height = PrintModel.GlyphSize;
            Grid g = (Grid)item.ContentTemplateRoot;

            g.ColumnDefinitions[0].Width = new GridLength(PrintModel.GlyphSize);

            TextBlock t = (TextBlock)g.Children[0];

            t.Height = t.Width = PrintModel.GlyphSize;

            TextBlock unicodeId = ((TextBlock)((StackPanel)g.Children[1]).Children[0]);

            unicodeId.SetVisible(PrintModel.Annotation != GlyphAnnotation.None);
            unicodeId.Text = c.GetAnnotation(PrintModel.Annotation);

            TextBlock description = ((TextBlock)((StackPanel)g.Children[1]).Children[1]);

            try
            {
                description.Text = GlyphService.GetCharacterDescription(c.UnicodeIndex, PrintModel.Font);
            }
            catch { }

            IXamlDirectObject o = _xamlDirect.GetXamlDirectObject(t);

            CharacterGridView.SetGlyphProperties(_xamlDirect, o, PrintModel.GetTemplateSettings(), c);

            foreach (var r in g.GetFirstLevelDescendantsOfType <Rectangle>())
            {
                r.SetVisible(PrintModel.ShowBorders);
            }
        }
예제 #2
0
        private static string GetFileName(
            InstalledFont selectedFont,
            FontVariant selectedVariant,
            Character selectedChar,
            string ext)
        {
            var chr = GlyphService.GetCharacterDescription(selectedChar.UnicodeIndex, selectedVariant) ?? selectedChar.UnicodeString;

            return($"{selectedFont.Name} {selectedVariant.PreferredName} - {chr}.{ext}");
        }
예제 #3
0
        public string GetDescription(Character c)
        {
            if (SearchMap == null ||
                !SearchMap.TryGetValue(c, out string mapping) ||
                string.IsNullOrWhiteSpace(mapping))
            {
                return(GlyphService.GetCharacterDescription(c.UnicodeIndex, this));
            }

            return(GlyphService.TryGetAGLFNName(mapping));
        }