Skip to content

Commit

Permalink
v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
john-ds committed Nov 5, 2022
1 parent dd61bf4 commit 8758664
Show file tree
Hide file tree
Showing 117 changed files with 7,897 additions and 4,704 deletions.
1,386 changes: 1,386 additions & 0 deletions Express Apps/CommonDictionaryEN.xaml

Large diffs are not rendered by default.

1,399 changes: 1,399 additions & 0 deletions Express Apps/CommonDictionaryES.xaml

Large diffs are not rendered by default.

1,387 changes: 1,387 additions & 0 deletions Express Apps/CommonDictionaryFR.xaml

Large diffs are not rendered by default.

1,403 changes: 1,403 additions & 0 deletions Express Apps/CommonDictionaryIT.xaml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions Express Apps/Express Apps.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="CommonDictionaryES.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="CommonDictionaryFR.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand All @@ -127,6 +131,10 @@
</Compile>
<Compile Include="FontItems.vb" />
<Compile Include="Funcs.vb" />
<Page Include="CommonDictionaryIT.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Experimental.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
75 changes: 75 additions & 0 deletions Express Apps/ExpressIcons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2848,6 +2848,46 @@
</Canvas>
</Viewbox>

<Viewbox x:Key="CorsivoIcon" x:Shared="False" Stretch="Uniform">
<Canvas Width="26.458333" Height="26.458334">
<Canvas.RenderTransform>
<TranslateTransform X="0" Y="0"/>
</Canvas.RenderTransform>
<Canvas.Resources>
<LinearGradientBrush xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Key="corsivo_linearGradient861" MappingMode="Absolute" StartPoint="-49,48" EndPoint="-64,23">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFA235D0" Offset="0"/>
<GradientStop Color="#FFB761DA" Offset="1"/>
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
<LinearGradientBrush.Transform>
<MatrixTransform Matrix="2.9151967 0 0 2.9151967 209.3343 -43.557837"/>
</LinearGradientBrush.Transform>
</LinearGradientBrush>
</Canvas.Resources>
<Canvas>
<Canvas.RenderTransform>
<TranslateTransform X="0" Y="-270.54165"/>
</Canvas.RenderTransform>
<Canvas Opacity="1">
<Canvas.RenderTransform>
<MatrixTransform Matrix="0.26458333 0 0 0.26458333 1.5591518 269.64396"/>
</Canvas.RenderTransform>
<Canvas Opacity="1">
<Canvas>
<Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="{StaticResource corsivo_linearGradient861}" StrokeThickness="0.999993">
<Path.Data>
<PathGeometry Figures="M 73.010473 67.242154 Q 72.042527 75.83979 67.14586 82.501535 62.249193 89.106342 54.39175 92.693435 46.534308 96.22359 37.42423 96.052777 29.225159 95.881963 23.132794 92.294869 17.04043 88.650838 13.510274 81.818279 10.037057 74.928783 9.581553 65.989518 9.1829871 58.986146 11.005003 48.566494 12.883956 38.146842 17.609809 30.061647 22.3926 21.976453 28.940469 17.2506 q 9.223954 -6.604807 21.067056 -6.377055 12.867986 0.227752 20.3838 7.971319 7.572753 7.686628 8.312946 21.408683 l -16.625892 -0.05694 q 0 -7.857442 -3.13159 -11.501473 -3.131589 -3.644032 -9.736396 -3.871784 -8.540698 -0.284689 -14.063683 6.092365 -5.466047 6.377055 -7.345001 18.618723 -1.822015 11.900039 -1.594263 17.82159 0.28469 7.515815 3.359341 11.102908 3.074651 3.530155 8.597636 3.700969 7.629691 0.28469 12.18473 -3.587093 4.611977 -3.928721 6.092365 -11.216784 z" FillRule="NonZero"/>
</Path.Data>
</Path>
</Canvas>
</Canvas>
</Canvas>
</Canvas>
</Canvas>
</Viewbox>

<Viewbox x:Key="CriticalIcon" x:Shared="False" Stretch="Uniform">
<Canvas Width="26.458333" Height="26.458334">
<Canvas.RenderTransform>
Expand Down Expand Up @@ -7280,6 +7320,41 @@
</Canvas>
</Viewbox>

<Viewbox x:Key="NegritaIcon" x:Shared="False" Stretch="Uniform">
<Canvas Width="26.458333" Height="26.458334">
<Canvas.RenderTransform>
<TranslateTransform X="0" Y="0"/>
</Canvas.RenderTransform>
<Canvas.Resources>
<LinearGradientBrush xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Key="negrita_linearGradient855" MappingMode="Absolute" StartPoint="73,90" EndPoint="16,17">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#FFA235D0" Offset="0"/>
<GradientStop Color="#FFB761DA" Offset="1"/>
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Canvas.Resources>
<Canvas>
<Canvas.RenderTransform>
<TranslateTransform X="0" Y="-270.54165"/>
</Canvas.RenderTransform>
<Canvas Opacity="1">
<Canvas.RenderTransform>
<MatrixTransform Matrix="0.26458333 0 0 0.26458333 1.5591518 269.64396"/>
</Canvas.RenderTransform>
<Canvas Opacity="1">
<Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="{StaticResource negrita_linearGradient855}" StrokeThickness="0.999995">
<Path.Data>
<PathGeometry Figures="M 78.744345 96.079742 H 61.191709 L 27.022578 40.028324 V 96.079742 H 9.4699413 V 10.890948 H 27.022578 l 34.22764 56.168436 V 10.890948 h 17.494127 z" FillRule="NonZero"/>
</Path.Data>
</Path>
</Canvas>
</Canvas>
</Canvas>
</Canvas>
</Viewbox>

<Viewbox x:Key="NetworkDriveIcon" x:Shared="False" Stretch="Uniform">
<Canvas Width="26.458333" Height="26.458334">
<Canvas.RenderTransform>
Expand Down
37 changes: 37 additions & 0 deletions Express Apps/ExpressStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,43 @@
</Setter>
</Style>

<Style x:Key="ChromeWindowStyle" TargetType="{x:Type Window}">
<Setter Property="WindowStyle" Value="SingleBorderWindow"/>
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome CaptionHeight="0" ResizeBorderThickness="2" UseAeroCaptionButtons="False"/>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Window}">
<Grid Background="{DynamicResource BackColor}">
<Border BorderThickness="1" BorderBrush="{DynamicResource AppColor}">
<Border.Style>
<Style TargetType="{x:Type Border}">
<Style.Triggers>
<!-- Add to avoid border disappearing when window is maximised -->
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource AncestorType=Window}}"
Value="Maximized">
<Setter Property="Margin" Value="7"/>
</DataTrigger>
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource AncestorType=Window}}"
Value="Normal">
<Setter Property="Margin" Value="0"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="ExpressCheckBox" TargetType="{x:Type CheckBox}">
<Setter Property="FocusVisualStyle" Value="{DynamicResource CheckBoxFocusVisual}"/>
<Setter Property="Background" Value="Transparent" />
Expand Down
115 changes: 108 additions & 7 deletions Express Apps/Funcs.vb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,74 @@ Imports Newtonsoft.Json

Public Class Funcs

Public Shared Function ChooseLang(english As String, french As String) As String
Public Shared Sub SetLang(lang As String)
Dim available = {"en-GB", "fr-FR", "es-ES", "it-IT"}
If available.Contains(lang) = False Then lang = "en-GB"

If Threading.Thread.CurrentThread.CurrentUICulture.Name = "fr-FR" Then
Return french
Else
Threading.Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo(lang)
Threading.Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(lang)

If lang <> "en-GB" Then
Dim commonresdict As New ResourceDictionary() With {
.Source = New Uri("/CommonDictionary" + lang.Split("-")(1) + ".xaml", UriKind.Relative)
}
Windows.Application.Current.Resources.MergedDictionaries.Add(commonresdict)

End If

End Sub

Public Shared Function ChooseLang(key As String) As String

Try
Return Windows.Application.Current.Resources.Item(key)
Catch
Return ""
End Try

End Function

Public Shared Function ChooseLang(info As Dictionary(Of String, Object)) As Object

Try
Return info(GetCurrentLang(True))
Catch
Return Nothing
End Try

End Function

Public Shared Function ChooseIcon(english As String) As String

If GetCurrentLang(True) = "en" Then
Return english

Else
Dim options As Dictionary(Of String, String)

Select Case english
Case "BoldIcon"
options = New Dictionary(Of String, String) From {{"fr", "GrasIcon"}, {"es", "NegritaIcon"}, {"it", "GrasIcon"}}
Case "ItalicIcon"
options = New Dictionary(Of String, String) From {{"fr", "ItalicIcon"}, {"es", "ItalicIcon"}, {"it", "CorsivoIcon"}}
Case "UnderlineIcon"
options = New Dictionary(Of String, String) From {{"fr", "SousligneIcon"}, {"es", "SousligneIcon"}, {"it", "SousligneIcon"}}
Case Else
Return "HelpIcon"
End Select

Return options(GetCurrentLang(True))

End If

End Function

Public Shared Function GetCurrentLang(Optional returnshort As Boolean = False) As String

If returnshort Then
Return Threading.Thread.CurrentThread.CurrentUICulture.Name.ToLower().Substring(0, 2)
Else
Return Threading.Thread.CurrentThread.CurrentUICulture.Name
End If

End Function
Expand Down Expand Up @@ -49,6 +111,45 @@ Public Class Funcs

End Function

Public Shared Function FormatBytes(BytesCaller As Long, Optional CsvFormat As Boolean = False) As String
Dim DoubleBytes As Double
Dim result As String = "—"

Try
Select Case BytesCaller
Case Is >= 1125899906842625
result = "1000+ " + ChooseLang("TBStr")
Case 1099511627776 To 1125899906842624
DoubleBytes = BytesCaller / 1099511627776 'TB
result = Math.Round(DoubleBytes, 2).ToString() + " " + ChooseLang("TBStr")
Case 1073741824 To 1099511627775
DoubleBytes = BytesCaller / 1073741824 'GB
result = Math.Round(DoubleBytes, 2).ToString() + " " + ChooseLang("GBStr")
Case 1048576 To 1073741823
DoubleBytes = BytesCaller / 1048576 'MB
result = Math.Round(DoubleBytes, 2).ToString() + " " + ChooseLang("MBStr")
Case 1024 To 1048575
DoubleBytes = BytesCaller / 1024 'KB
result = Math.Round(DoubleBytes, 2).ToString() + " " + ChooseLang("KBStr")
Case 1 To 1023
DoubleBytes = BytesCaller ' bytes
result = Math.Round(DoubleBytes, 2).ToString() + " " + ChooseLang("BStr")
Case Else
Return result
End Select

If CsvFormat And result.Contains(",") Then
Return """" + result + """"
Else
Return result
End If

Catch
Return result
End Try

End Function

<DllImport("user32.dll")>
Shared Function ReleaseCapture() As Boolean
End Function
Expand Down Expand Up @@ -140,7 +241,7 @@ Public Class Funcs

Public Shared Function GetXmlLocaleString(nodes As Xml.XmlNodeList) As String

If ChooseLang("en", "fr") = "en" Then
If GetCurrentLang(True) = "en" Then
For Each i As Xml.XmlNode In nodes
If i.OuterXml.StartsWith("<en>") Then
Return i.InnerText
Expand All @@ -153,7 +254,7 @@ Public Class Funcs
For Each i As Xml.XmlNode In nodes
If i.OuterXml.StartsWith("<en>") Then
en = i.InnerText
ElseIf i.OuterXml.StartsWith("<fr>") Then
ElseIf i.OuterXml.StartsWith("<" + GetCurrentLang(True) + ">") Then
Return i.InnerText
End If
Next
Expand Down Expand Up @@ -189,7 +290,7 @@ Public Class Funcs
ElseIf i.OuterXml.StartsWith("<importance>") Then
notification(1) = i.InnerText

ElseIf i.OuterXml.StartsWith(ChooseLang("<features_en>", "<features_fr>")) Then
ElseIf i.OuterXml.StartsWith("<features_" + GetCurrentLang(True) + ">") Then
notification.Add(EscapeChars(i.InnerText, True))

End If
Expand Down
4 changes: 2 additions & 2 deletions Express Apps/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("2.1.1.0")>
<Assembly: AssemblyFileVersion("2.1.1.0")>
<Assembly: AssemblyVersion("2.2.0.0")>
<Assembly: AssemblyFileVersion("2.2.0.0")>
4 changes: 2 additions & 2 deletions ExpressControls/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("2.1.1.0")>
<Assembly: AssemblyFileVersion("2.1.1.0")>
<Assembly: AssemblyVersion("2.2.0.0")>
<Assembly: AssemblyFileVersion("2.2.0.0")>
2 changes: 1 addition & 1 deletion Font Express/About.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="{DynamicResource AboutStr}" Width="450" Background="{x:Null}" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" UseLayoutRounding="True" SizeToContent="Height" AllowsTransparency="True" WindowStyle="None">
Title="{DynamicResource AboutFStr}" Width="450" Background="{x:Null}" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" UseLayoutRounding="True" SizeToContent="Height" AllowsTransparency="True" WindowStyle="None">
<Window.Resources>
<Storyboard x:Key="EntranceStoryboard">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="grid">
Expand Down
5 changes: 2 additions & 3 deletions Font Express/About.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
InitializeComponent()

' Add any initialization after the InitializeComponent() call.
VersionTxt.Text = "Version " + My.Application.Info.Version.ToString(3)
VersionTxt.Text = Funcs.ChooseLang("VersionStr") + " " + My.Application.Info.Version.ToString(3)
CopyrightTxt.Text = My.Application.Info.Copyright
DescriptionTxt.Text = Funcs.ChooseLang($"Thank you for installing Font Express.{Environment.NewLine}Choose fonts with ease by organising them into categories and setting your favourites, giving you quick access to the fonts you need.{Environment.NewLine}{Environment.NewLine}To find out about how to use the features available, visit the Help section. You can also leave your feedback there - it is greatly appreciated!{Environment.NewLine}{Environment.NewLine}The app and the Font Express logo are copyright John D. In-app icon designs from icons8.com. Illustrations from stories.freepik.com.",
$"Merci d'avoir installé Font Express.{Environment.NewLine}Choisissez facilement des polices en les organisant en catégories et en définissant vos favoris, vous donnant ainsi un accès rapide aux polices dont vous avez besoin.{Environment.NewLine}{Environment.NewLine}Pour savoir comment utiliser les fonctionnalités disponibles, consultez la section Aide. Vous pouvez également laisser vos commentaires là-bas - c'est grandement apprécié !{Environment.NewLine}{Environment.NewLine}L'application et le logo Font Express sont copyright John D. Conceptions d'icônes intégrées à l'application à partir de icons8.com. Illustrations à partir de stories.freepik.com.")
DescriptionTxt.Text = Funcs.ChooseLang("AboutDescFStr")

End Sub

Expand Down
16 changes: 7 additions & 9 deletions Font Express/AddEditCategory.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,19 @@
Private Sub OKBtn_Click(sender As Object, e As RoutedEventArgs) Handles OKBtn.Click

If CategoryTxt.Text.Replace(" ", "") = "" Then
MainWindow.NewMessage(Funcs.ChooseLang("Please enter a category name first.", "Veuillez d'abord saisir un nom de catégorie."),
Funcs.ChooseLang("Category Error", "Erreur de Catégorie"), MessageBoxButton.OK, MessageBoxImage.Error)
MainWindow.NewMessage(Funcs.ChooseLang("NoCategoryNameStr"),
Funcs.ChooseLang("CategoryErrorStr"), MessageBoxButton.OK, MessageBoxImage.Error)

ElseIf CategoryTxt.Text.Contains("//") Then
MainWindow.NewMessage(Funcs.ChooseLang("Category names cannot contain two slashes (//).",
"Les noms de catégorie ne peuvent pas contenir deux barres obliques (//)."),
Funcs.ChooseLang("Category Error", "Erreur de Catégorie"), MessageBoxButton.OK, MessageBoxImage.Error)
MainWindow.NewMessage(Funcs.ChooseLang("CategorySlashErrorStr"),
Funcs.ChooseLang("CategoryErrorStr"), MessageBoxButton.OK, MessageBoxImage.Error)

Else
Dim count = 0
For Each i In My.Settings.categories
If count <> CategoryIdx And (i.Split("//")(0) = CategoryTxt.Text Or CategoryTxt.Text = "Favourites" Or CategoryTxt.Text = "Favoris") Then
MainWindow.NewMessage(Funcs.ChooseLang("That category name is already taken. Please try a different one.",
"Ce nom de catégorie est déjà pris. Veuillez en essayer un autre."),
Funcs.ChooseLang("Category Error", "Erreur de Catégorie"), MessageBoxButton.OK, MessageBoxImage.Error)
If count <> CategoryIdx And i.Split("//")(0) = CategoryTxt.Text Then
MainWindow.NewMessage(Funcs.ChooseLang("CategoryTakenStr"),
Funcs.ChooseLang("CategoryErrorStr"), MessageBoxButton.OK, MessageBoxImage.Error)
Exit Sub
End If

Expand Down
1 change: 0 additions & 1 deletion Font Express/Application.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ShutdownMode="OnLastWindowClose">
<ResourceDictionary Source="ExpressIcons.xaml"/>
<ResourceDictionary Source="ExpressStyles.xaml"/>
<ResourceDictionary Source="CommonDictionaryEN.xaml"/>
<ResourceDictionary Source="DictionaryEN.xaml"/>
<ResourceDictionary Source="ColorIcons.xaml"/>

</ResourceDictionary.MergedDictionaries>
Expand Down
Loading

0 comments on commit 8758664

Please sign in to comment.