mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 19:22:53 +01:00
Export to images alignment option "Center, left justify" - thx Shota :)
This commit is contained in:
parent
dc6cdbd4c2
commit
15569ae7f7
@ -5,12 +5,14 @@
|
||||
* NEW:
|
||||
* Some support for SMPTE time code (drop frame) in video player
|
||||
* Swap text up/down - thx Leon
|
||||
* Shortcuts for moving text up/down in current sub - thx Leon
|
||||
* IMPROVED:
|
||||
* Update Bulgarian translation - thx KalinM
|
||||
* Update Hungarian translation - thx ZityiSoft Team
|
||||
* Update Korean translation - thx domddol
|
||||
* Waveform insert sub now works not just at end - thx Leon
|
||||
* Allow larger "margin" in SSA/ASSA styles - thx von Suppé
|
||||
* Export to images alignment option "Center, left justify" - thx Shota
|
||||
* FIXED:
|
||||
* Fix Ctrl+v of time code in "Time code control" (regr. from 3.5.5) - thx Mohammed
|
||||
* Fix for format "TTML draft 2006-10" - thx thehulk
|
||||
|
@ -461,6 +461,7 @@ Note: Do check free disk space.</WaveFileMalformed>
|
||||
<Left>Left</Left>
|
||||
<Right>Right</Right>
|
||||
<Center>Center</Center>
|
||||
<CenterLeftJustify>Center, left justify</CenterLeftJustify>
|
||||
<BottomMargin>Bottom margin</BottomMargin>
|
||||
<LeftRightMargin>Left/right margin</LeftRightMargin>
|
||||
<SaveBluRraySupAs>Choose Blu-ray sup file name</SaveBluRraySupAs>
|
||||
|
@ -641,6 +641,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
Left = "Left",
|
||||
Center = "Center",
|
||||
Right = "Right",
|
||||
CenterLeftJustify = "Center, left justify",
|
||||
BottomMargin = "Bottom margin",
|
||||
LeftRightMargin = "Left/right margin",
|
||||
SaveBluRraySupAs = "Choose Blu-ray sup file name",
|
||||
|
@ -1189,6 +1189,9 @@ namespace Nikse.SubtitleEdit.Core
|
||||
case "ExportPngXml/Center":
|
||||
language.ExportPngXml.Center = reader.Value;
|
||||
break;
|
||||
case "ExportPngXml/CenterLeftJustify":
|
||||
language.ExportPngXml.CenterLeftJustify = reader.Value;
|
||||
break;
|
||||
case "ExportPngXml/BottomMargin":
|
||||
language.ExportPngXml.BottomMargin = reader.Value;
|
||||
break;
|
||||
|
@ -516,6 +516,7 @@
|
||||
public string Left { get; set; }
|
||||
public string Right { get; set; }
|
||||
public string Center { get; set; }
|
||||
public string CenterLeftJustify { get; set; }
|
||||
public string BottomMargin { get; set; }
|
||||
public string LeftRightMargin { get; set; }
|
||||
public string SaveBluRraySupAs { get; set; }
|
||||
|
25
src/Forms/ExportPngXml.Designer.cs
generated
25
src/Forms/ExportPngXml.Designer.cs
generated
@ -37,6 +37,7 @@
|
||||
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.groupBoxImageSettings = new System.Windows.Forms.GroupBox();
|
||||
this.checkBoxFcpFullPathUrl = new System.Windows.Forms.CheckBox();
|
||||
this.labelResize = new System.Windows.Forms.Label();
|
||||
this.comboBoxResizePercentage = new System.Windows.Forms.ComboBox();
|
||||
this.comboBoxBottomMarginUnit = new System.Windows.Forms.ComboBox();
|
||||
@ -104,7 +105,6 @@
|
||||
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.checkBoxFcpFullPathUrl = new System.Windows.Forms.CheckBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.contextMenuStrip1.SuspendLayout();
|
||||
this.groupBoxImageSettings.SuspendLayout();
|
||||
@ -232,6 +232,16 @@
|
||||
this.groupBoxImageSettings.TabStop = false;
|
||||
this.groupBoxImageSettings.Text = "Image settings";
|
||||
//
|
||||
// checkBoxFcpFullPathUrl
|
||||
//
|
||||
this.checkBoxFcpFullPathUrl.AutoSize = true;
|
||||
this.checkBoxFcpFullPathUrl.Location = new System.Drawing.Point(13, 162);
|
||||
this.checkBoxFcpFullPathUrl.Name = "checkBoxFcpFullPathUrl";
|
||||
this.checkBoxFcpFullPathUrl.Size = new System.Drawing.Size(182, 17);
|
||||
this.checkBoxFcpFullPathUrl.TabIndex = 62;
|
||||
this.checkBoxFcpFullPathUrl.Text = "Use full image path url in FCP xml";
|
||||
this.checkBoxFcpFullPathUrl.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// labelResize
|
||||
//
|
||||
this.labelResize.AutoSize = true;
|
||||
@ -655,7 +665,8 @@
|
||||
this.comboBoxHAlign.Items.AddRange(new object[] {
|
||||
"Left",
|
||||
"Center",
|
||||
"Right"});
|
||||
"Right",
|
||||
"Center - Left justify"});
|
||||
this.comboBoxHAlign.Location = new System.Drawing.Point(112, 105);
|
||||
this.comboBoxHAlign.Name = "comboBoxHAlign";
|
||||
this.comboBoxHAlign.Size = new System.Drawing.Size(121, 21);
|
||||
@ -1041,16 +1052,6 @@
|
||||
this.subtitleListView1.SelectedIndexChanged += new System.EventHandler(this.subtitleListView1_SelectedIndexChanged);
|
||||
this.subtitleListView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.subtitleListView1_KeyDown);
|
||||
//
|
||||
// checkBoxFcpFullPathUrl
|
||||
//
|
||||
this.checkBoxFcpFullPathUrl.AutoSize = true;
|
||||
this.checkBoxFcpFullPathUrl.Location = new System.Drawing.Point(13, 162);
|
||||
this.checkBoxFcpFullPathUrl.Name = "checkBoxFcpFullPathUrl";
|
||||
this.checkBoxFcpFullPathUrl.Size = new System.Drawing.Size(182, 17);
|
||||
this.checkBoxFcpFullPathUrl.TabIndex = 62;
|
||||
this.checkBoxFcpFullPathUrl.Text = "Use full image path url in FCP xml";
|
||||
this.checkBoxFcpFullPathUrl.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// ExportPngXml
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@ -56,6 +56,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
public bool SimpleRendering { get; set; }
|
||||
public bool AlignLeft { get; set; }
|
||||
public bool AlignRight { get; set; }
|
||||
public bool JustifyLeft { get; set; }
|
||||
public byte[] Buffer { get; set; }
|
||||
public int ScreenWidth { get; set; }
|
||||
public int ScreenHeight { get; set; }
|
||||
@ -352,6 +353,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
SimpleRendering = checkBoxSimpleRender.Checked,
|
||||
AlignLeft = comboBoxHAlign.SelectedIndex == 0,
|
||||
AlignRight = comboBoxHAlign.SelectedIndex == 2,
|
||||
JustifyLeft = comboBoxHAlign.SelectedIndex == 3, // center, left justify
|
||||
ScreenWidth = screenWidth,
|
||||
ScreenHeight = screenHeight,
|
||||
VideoResolution = comboBoxResolution.Text,
|
||||
@ -2020,6 +2022,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
|
||||
mbp.AlignLeft = comboBoxHAlign.SelectedIndex == 0;
|
||||
mbp.AlignRight = comboBoxHAlign.SelectedIndex == 2;
|
||||
mbp.JustifyLeft = comboBoxHAlign.SelectedIndex == 3;
|
||||
mbp.SimpleRendering = checkBoxSimpleRender.Checked;
|
||||
mbp.BorderWidth = _borderWidth;
|
||||
mbp.BorderColor = _borderColor;
|
||||
@ -2475,7 +2478,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
}
|
||||
|
||||
private static readonly Dictionary<string, int> PaddingDictionary = new Dictionary<string, int>();
|
||||
private static Bitmap GenerateImageFromTextWithStyleInner(MakeBitmapParameter parameter)
|
||||
private static Bitmap GenerateImageFromTextWithStyleInner(MakeBitmapParameter parameter) // for UI
|
||||
{
|
||||
string text = parameter.P.Text;
|
||||
|
||||
@ -2603,6 +2606,16 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
}
|
||||
}
|
||||
|
||||
if (parameter.JustifyLeft)
|
||||
{
|
||||
// left justify centered lines
|
||||
var minX = lefts.Min(p => p);
|
||||
for (var index = 0; index < lefts.Count; index++)
|
||||
{
|
||||
lefts[index] = minX;
|
||||
}
|
||||
}
|
||||
|
||||
var sf = new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Near };
|
||||
|
||||
using (var g = Graphics.FromImage(bmp))
|
||||
@ -2741,7 +2754,6 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
var colorStack = new Stack<Color>();
|
||||
var fontStack = new Stack<Font>();
|
||||
var lastText = new StringBuilder();
|
||||
int numberOfCharsOnCurrentLine = 0;
|
||||
for (var i = 0; i < text.Length; i++)
|
||||
{
|
||||
if (text.Substring(i).StartsWith("<font ", StringComparison.OrdinalIgnoreCase))
|
||||
@ -2995,15 +3007,10 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
leftMargin = lefts[lineNumber];
|
||||
left = leftMargin;
|
||||
}
|
||||
numberOfCharsOnCurrentLine = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (numberOfCharsOnCurrentLine != 0 || text[i] != ' ')
|
||||
{
|
||||
sb.Append(text[i]);
|
||||
numberOfCharsOnCurrentLine++;
|
||||
}
|
||||
sb.Append(text[i]);
|
||||
}
|
||||
}
|
||||
if (sb.Length > 0)
|
||||
@ -3453,6 +3460,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
comboBoxHAlign.Items.Add(Configuration.Settings.Language.ExportPngXml.Left);
|
||||
comboBoxHAlign.Items.Add(Configuration.Settings.Language.ExportPngXml.Center);
|
||||
comboBoxHAlign.Items.Add(Configuration.Settings.Language.ExportPngXml.Right);
|
||||
comboBoxHAlign.Items.Add(Configuration.Settings.Language.ExportPngXml.CenterLeftJustify);
|
||||
}
|
||||
|
||||
buttonShadowColor.Text = Configuration.Settings.Language.ExportPngXml.ShadowColor;
|
||||
|
Loading…
Reference in New Issue
Block a user