Fixed baseline horizontal alignment in Export to Blu-ray sup - thx THXTEX :)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1895 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2013-06-29 06:57:54 +00:00
parent 1c3f87926c
commit bbc56f3df3
3 changed files with 19 additions and 9 deletions

View File

@ -16,7 +16,8 @@
* Fixed annoying crash when loading a subtitle from 'source view'
* OCR - Change ocr fix language when changing spell check dictionary
* Fixed Hebrew in PAC files - thx Yaniv
* Fixed minor language detection bug regarding Korean - thx Hoyt :)
* Fixed minor language detection bug regarding Korean - thx Hoyt
* Fixed baseline horizontal alignment in Export to Blu-ray sup - thx THXTEX
3.3.6 (15th June 2013)

View File

@ -1042,16 +1042,16 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
BdnXmlTimeCode(param.P.EndTime) + "\" Forced=\"False\">");
int x = (width - param.Bitmap.Width) / 2;
int y = height - (param.Bitmap.Height + border);
int y = height - (param.Bitmap.Height + param.BottomMargin);
switch (param.Alignment)
{
case ContentAlignment.BottomLeft:
x = border;
y = height - (param.Bitmap.Height + border);
y = height - (param.Bitmap.Height + param.BottomMargin);
break;
case ContentAlignment.BottomRight:
x = height - param.Bitmap.Width - border;
y = height - (param.Bitmap.Height + border);
y = height - (param.Bitmap.Height + param.BottomMargin);
break;
case ContentAlignment.MiddleCenter:
x = (width - param.Bitmap.Width) / 2;
@ -1313,6 +1313,17 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
if (parameter.BackgroundColor != Color.Transparent)
g.FillRectangle(new SolidBrush(parameter.BackgroundColor), 0, 0, bmp.Width, bmp.Height);
// align lines with gjpqy a bit lower
var lines = text.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
if (lines[lines.Length - 1].Contains("g") || lines[lines.Length - 1].Contains("j") || lines[lines.Length - 1].Contains("p") || lines[lines.Length - 1].Contains("q") || lines[lines.Length - 1].Contains("y"))
{
string textNoBelow = lines[lines.Length - 1].Replace("g", "a").Replace("j", "a").Replace("p", "a").Replace("q", "a").Replace("y", "a");
int removeFromBottomMargin = (int)Math.Round((TextDraw.MeasureTextHeight(font, lines[lines.Length - 1], parameter.SubtitleFontBold) - TextDraw.MeasureTextHeight(font, textNoBelow, parameter.SubtitleFontBold)));
parameter.BottomMargin -= removeFromBottomMargin;
if (parameter.BottomMargin < 0)
parameter.BottomMargin = 0;
}
var lefts = new List<float>();
foreach (string line in Utilities.RemoveHtmlFontTag(text.Replace("<i>", string.Empty).Replace("</i>", string.Empty)).Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{

View File

@ -77,7 +77,7 @@ namespace Nikse.SubtitleEdit.Logic
if (list[i].X > width)
width = list[i].X;
}
int max = 45;
int max = 50;
if (max > list.Length)
max = list.Length;
for (int i = 0; i < max; i++)
@ -111,10 +111,8 @@ namespace Nikse.SubtitleEdit.Logic
if (list[i].Y > height)
height = list[i].Y;
}
int max = 85;
if (max > list.Length)
max = list.Length;
for (int i = 0; i < max; i++)
for (int i = 0; i < list.Length; i++)
{
if (list[i].Y > height)
height = list[i].Y;