Skip to content

Commit

Permalink
Merge pull request #296 from character-map-uwp/Nov-23
Browse files Browse the repository at this point in the history
Nov 23
  • Loading branch information
EdiWang authored Nov 11, 2023
2 parents 039e3dd + 36ee0a1 commit 017ecc1
Show file tree
Hide file tree
Showing 209 changed files with 41,229 additions and 35,308 deletions.
7 changes: 3 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
Expand All @@ -11,7 +10,6 @@
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
Expand All @@ -34,7 +32,6 @@
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
Expand All @@ -43,7 +40,6 @@
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
Expand All @@ -61,3 +57,6 @@
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
CharacterMap/CharacterMap/Assets/Data/GlyphData.db filter=lfs diff=lfs merge=lfs -text
CharacterMap/CharacterMap/Assets/Data/Unihan_Readings.txt filter=lfs diff=lfs merge=lfs -text
0_artifacts/*.png filter=lfs diff=lfs merge=lfs -text
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,4 @@ ModelManifest.xml
*.appx
CharacterMap/CharacterMap.CX/Generated Files
CharacterMap/enc_temp_folder
lfs
3 changes: 3 additions & 0 deletions 0_artifacts/Screen_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions 0_artifacts/Screen_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions 0_artifacts/Screen_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions 0_artifacts/Screen_05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions 0_artifacts/Screen_06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions 0_artifacts/StoreListing.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

A modern, native UWP replacement for the Win32 Character Map and Windows Font Viewer with flawless high DPI and touch support. Features include:

- View all fonts families and font faces installed on your device and import your own, including support for .WOFF and .WOFF2 fonts, Variable fonts and Color fonts.
- View all fonts families and font faces installed on your device and import your own, including support for .WOFF and .WOFF2 fonts, Variable fonts and Color fonts (including COLR V1 on supported versions of Windows 11)
- View all the Characters in a font face, along with typographic and color variants
- Explore and change Variable font axis for fonts in realtime in Type Ramp view
- Practice drawing characters in your chosen font in Calligraphy view
- Compare all fonts at once in Compare view, or compare individual families or specific faces with Quick Compare view
- Create and manage custom font collections
- View font properties like their designer, description, licenses, PANOSE, etc
- Copy Characters to your clipboard
- Copy Characters to your clipboard as text, SVG or PNG
- Copy XAML, C++, C#, MAUI code and more for Characters for programming features like FontIcon, SymbolIcon and text properties
- Export Characters individually or in bulk as PNG and SVG files, or print off entire character sheets
- Search for characters inside fonts by unicode character name, unicode index, or the font's own custom named glyphs, including native search supported for Segoe MDL2/Fluent Icons
- Create and manage custom font collections
- Export Characters individually or in bulk as PNG and SVG files, and print off entire character sheets
- Search for characters inside fonts by unicode character name, unicode index, or the font's own custom named glyphs, including native search support for Segoe MDL2/Fluent Icons
- Export font files from the app including system fonts to share with others, and you can even export entire collections as a single ZIP archive
- Use as the default .WOFF and .WOFF2 font viewer applications, allowing you to preview .WOFF and .WOFF2 files from Windows Explorer
- Use as the default .WOFF and .WOFF2 font viewer applications, allowing you to preview .WOFF and .WOFF2 files from Windows Explorer
- Allows you to install .WOFF and .WOFF2 fonts to use in all your Windows applications
Binary file modified 0_artifacts/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
134 changes: 134 additions & 0 deletions CharacterMap/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,137 @@ dotnet_diagnostic.IDE0058.severity = none

# Default severity for analyzer diagnostics with category 'Style'
dotnet_analyzer_diagnostic.category-Style.severity = none

[*.cs]
#### Naming styles ####

# Naming rules

dotnet_naming_rule.private_prop_should_be_begins_with_underscore.severity = suggestion
dotnet_naming_rule.private_prop_should_be_begins_with_underscore.symbols = private_prop
dotnet_naming_rule.private_prop_should_be_begins_with_underscore.style = begins_with_underscore

# Symbol specifications

dotnet_naming_symbols.private_prop.applicable_kinds = property, field
dotnet_naming_symbols.private_prop.applicable_accessibilities = private
dotnet_naming_symbols.private_prop.required_modifiers =

# Naming styles

dotnet_naming_style.begins_with_underscore.required_prefix = _
dotnet_naming_style.begins_with_underscore.required_suffix =
dotnet_naming_style.begins_with_underscore.word_separator =
dotnet_naming_style.begins_with_underscore.capitalization = camel_case
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = file_scoped:suggestion
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_indent_labels = one_less_than_current
csharp_space_around_binary_operators = before_and_after
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
csharp_prefer_static_local_function = true:suggestion
csharp_style_prefer_readonly_struct = true:suggestion
csharp_style_prefer_readonly_struct_member = true:suggestion
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
csharp_style_conditional_delegate_call = true:suggestion

[*.{cs,vb}]
#### Naming styles ####

# Naming rules

dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

# Symbol specifications

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_readonly_field = true:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
15 changes: 10 additions & 5 deletions CharacterMap/CharacterMap.CX/DWriteFontFace.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ namespace CharacterMapCX
ThrowIfFailed(m_font->GetInformationalStrings(
static_cast<DWRITE_INFORMATIONAL_STRING_ID>(fontInformation), &localizedStrings, &exists));


if (localizedStrings)
if (exists)
{
const uint32_t stringCount = localizedStrings->GetCount();

Expand All @@ -74,10 +73,16 @@ namespace CharacterMapCX
wchar_t* name = new wchar_t[length + 1];
localizedStrings->GetString(i, name, length);

wchar_t* locale;
localizedStrings->GetLocaleNameLength(i, &length);
length++;
wchar_t* locale = new wchar_t[length + 1];
localizedStrings->GetLocaleName(i, locale, length);
if (length == 0)
locale = name;
else
{
length++;
locale = new wchar_t[length + 1];
localizedStrings->GetLocaleName(i, locale, length);
}

ThrowIfFailed(map->Insert(
ref new String(locale), ref new String(name)));
Expand Down
39 changes: 18 additions & 21 deletions CharacterMap/CharacterMap/Activation/ActivationHandler.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
using System.Threading.Tasks;
namespace CharacterMap.Activation;

namespace CharacterMap.Activation
public abstract class ActivationHandler
{
public abstract class ActivationHandler
public abstract bool CanHandle(object args);
public abstract Task HandleAsync(object args);
}

public abstract class ActivationHandler<T> : ActivationHandler where T : class
{
protected abstract Task HandleInternalAsync(T args);

public override async Task HandleAsync(object args)
{
public abstract bool CanHandle(object args);
public abstract Task HandleAsync(object args);
await HandleInternalAsync(args as T);
}

public abstract class ActivationHandler<T> : ActivationHandler where T : class
public override bool CanHandle(object args)
{
protected abstract Task HandleInternalAsync(T args);

public override async Task HandleAsync(object args)
{
await HandleInternalAsync(args as T);
}

public override bool CanHandle(object args)
{
return args is T && CanHandleInternal(args as T);
}
return args is T && CanHandleInternal(args as T);
}

protected virtual bool CanHandleInternal(T args)
{
return true;
}
protected virtual bool CanHandleInternal(T args)
{
return true;
}
}
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
using System;
using System.Threading.Tasks;
using CharacterMap.Services;
using CommunityToolkit.Mvvm.DependencyInjection;
using Windows.ApplicationModel.Activation;

namespace CharacterMap.Activation
namespace CharacterMap.Activation;

internal class DefaultLaunchActivationHandler : ActivationHandler<ILaunchActivatedEventArgs>
{
internal class DefaultLaunchActivationHandler : ActivationHandler<ILaunchActivatedEventArgs>
private readonly string _navElement;

private NavigationServiceEx NavigationService => Ioc.Default.GetService<NavigationServiceEx>();

public DefaultLaunchActivationHandler(Type navElement)
{
private readonly string _navElement;

private NavigationServiceEx NavigationService => Ioc.Default.GetService<NavigationServiceEx>();
_navElement = navElement.FullName;
}

public DefaultLaunchActivationHandler(Type navElement)
{
_navElement = navElement.FullName;
}

protected override async Task HandleInternalAsync(ILaunchActivatedEventArgs args)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
NavigationService.Navigate(_navElement, args.Arguments);
protected override async Task HandleInternalAsync(ILaunchActivatedEventArgs args)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
NavigationService.Navigate(_navElement, args.Arguments);

// You can use this sample to create toast notifications where needed in your app.
// Singleton<ToastNotificationsService>.Instance.ShowSavedNotification();
await Task.CompletedTask;
}
// You can use this sample to create toast notifications where needed in your app.
// Singleton<ToastNotificationsService>.Instance.ShowSavedNotification();
await Task.CompletedTask;
}

protected override bool CanHandleInternal(ILaunchActivatedEventArgs args)
{
// None of the ActivationHandlers has handled the app activation
return NavigationService.Frame.Content == null;
}
protected override bool CanHandleInternal(ILaunchActivatedEventArgs args)
{
// None of the ActivationHandlers has handled the app activation
return NavigationService.Frame.Content == null;
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel.Activation;
using Windows.ApplicationModel.Activation;

namespace CharacterMap.Activation
{
Expand Down
2 changes: 2 additions & 0 deletions CharacterMap/CharacterMap/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<ResourceDictionary>
<converters:ZoomBackgroundConverter x:Key="ZoomBackgroundConverter" />
<converters:CasingConverter x:Key="CasingConverter" />
<converters:VisibilityConverter x:Key="VisConverter" />

<Style TargetType="FontIcon">
<Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
Expand All @@ -42,6 +43,7 @@

<BrushTransition x:Key="RootBackgroundTransition" Duration="0:0:0.25" />
<BrushTransition x:Key="QuickBackgroundTransition" Duration="0:0:0.1" />
<BrushTransition x:Key="BackgroundTransition" Duration="0:0:0.15" />

<TransitionCollection x:Key="NoTransitions" />
<TransitionCollection x:Key="RepositionTransitions">
Expand Down
Loading

0 comments on commit 017ecc1

Please sign in to comment.