diff --git a/OnlyV.ImageCreation/BibleTextImage.cs b/OnlyV.ImageCreation/BibleTextImage.cs index d868841c..143695a3 100644 --- a/OnlyV.ImageCreation/BibleTextImage.cs +++ b/OnlyV.ImageCreation/BibleTextImage.cs @@ -88,6 +88,7 @@ public BibleTextImage() BodyDropShadowOpacity = 0.5; BodyDropShadowBlurRadius = 10; BodyDropShadowDepth = 10; + BodyVerticalAlignment = OnlyVBodyVerticalAlignment.Middle; UseTildeParaSeparator = true; TrimPunctuation = false; @@ -182,7 +183,9 @@ public Color BackgroundColor public double BodyDropShadowBlurRadius { get; set; } public double BodyDropShadowDepth { get; set; } - + + public OnlyVBodyVerticalAlignment BodyVerticalAlignment { get; set; } + private Brush BackgroundBrush => _backgroundBrush ?? (_backgroundBrush = new SolidColorBrush(BackgroundColor)); public IEnumerable Generate(string epubPath, int bookNumber, string chapterAndVerses) @@ -479,7 +482,7 @@ private DrawingVisual DrawBody( int lineCount = linesForBmp.Length; double adjustmentForShortLineCount = 0; - if (lineCount < linesPerImage) + if (BodyVerticalAlignment == OnlyVBodyVerticalAlignment.Middle && lineCount < linesPerImage) { adjustmentForShortLineCount = (lineHeight * (linesPerImage - lineCount)) / 2; } diff --git a/OnlyV.Themes.Common/OnlyV.Themes.Common.csproj b/OnlyV.Themes.Common/OnlyV.Themes.Common.csproj index 87c4f6d9..4bed642a 100644 --- a/OnlyV.Themes.Common/OnlyV.Themes.Common.csproj +++ b/OnlyV.Themes.Common/OnlyV.Themes.Common.csproj @@ -107,6 +107,7 @@ + diff --git a/OnlyV.Themes.Common/Specs/OnlyVBodyTextSpec.cs b/OnlyV.Themes.Common/Specs/OnlyVBodyTextSpec.cs index 594f0b81..808011c3 100644 --- a/OnlyV.Themes.Common/Specs/OnlyVBodyTextSpec.cs +++ b/OnlyV.Themes.Common/Specs/OnlyVBodyTextSpec.cs @@ -15,6 +15,8 @@ public OnlyVBodyTextSpec() LineSpacing = OnlyVLineSpacing.Normal; DropShadow = new OnlyVDropShadowSpec { Show = true }; + + BodyVerticalAlignment = OnlyVBodyVerticalAlignment.Middle; } public OnlyVFontSpec Font { get; set; } @@ -24,5 +26,7 @@ public OnlyVBodyTextSpec() public OnlyVLineSpacing LineSpacing { get; set; } public OnlyVDropShadowSpec DropShadow { get; set; } + + public OnlyVBodyVerticalAlignment BodyVerticalAlignment { get; set; } } } diff --git a/OnlyV.Themes.Common/Specs/OnlyVBodyVerticalAlignment.cs b/OnlyV.Themes.Common/Specs/OnlyVBodyVerticalAlignment.cs new file mode 100644 index 00000000..e2c9bb5d --- /dev/null +++ b/OnlyV.Themes.Common/Specs/OnlyVBodyVerticalAlignment.cs @@ -0,0 +1,8 @@ +namespace OnlyV.Themes.Common.Specs +{ + public enum OnlyVBodyVerticalAlignment + { + Top, + Middle + } +} diff --git a/OnlyV/Services/Images/ImagesService.cs b/OnlyV/Services/Images/ImagesService.cs index 6f35e634..3c7eeeee 100644 --- a/OnlyV/Services/Images/ImagesService.cs +++ b/OnlyV/Services/Images/ImagesService.cs @@ -167,6 +167,7 @@ private void ApplyFormatting( bibleTextImage.BodyDropShadowColor = ConvertFromString(theme.BodyText.DropShadow.Colour, Colors.Black); bibleTextImage.BodyDropShadowDepth = theme.BodyText.DropShadow.Depth; bibleTextImage.BodyDropShadowOpacity = theme.BodyText.DropShadow.Opacity; + bibleTextImage.BodyVerticalAlignment = theme.BodyText.BodyVerticalAlignment; // title text... bibleTextImage.TitleFont.FontFamily = new FontFamily(theme.TitleText.Font.Family); diff --git a/OnlyVThemeCreator/Helpers/StandardTextSample.cs b/OnlyVThemeCreator/Helpers/StandardTextSample.cs index 1271dc2e..8477efa0 100644 --- a/OnlyVThemeCreator/Helpers/StandardTextSample.cs +++ b/OnlyVThemeCreator/Helpers/StandardTextSample.cs @@ -23,7 +23,8 @@ public static IReadOnlyCollection GetStandardList() { new StandardTextSample(100, 1, "3:15,16"), new StandardTextSample(101, 19, "119:1-8"), - new StandardTextSample(102, 66, "21:1-4") + new StandardTextSample(102, 66, "21:1-4"), + new StandardTextSample(103, 43, "11:35") }; } } diff --git a/OnlyVThemeCreator/MainWindow.xaml b/OnlyVThemeCreator/MainWindow.xaml index aed8d231..63950f0f 100644 --- a/OnlyVThemeCreator/MainWindow.xaml +++ b/OnlyVThemeCreator/MainWindow.xaml @@ -319,13 +319,13 @@ materialDesign:HintAssist.Hint="{x:Static resx:Resources.FONT_WEIGHT}" Style="{StaticResource FloatingHintComboBoxStyle}" /> -