Skip to content

Commit

Permalink
Change cutting and font fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
lay295 committed Sep 17, 2020
1 parent 067d8ac commit a1fa85a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions TwitchDownloaderCore/ChatRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ public static SKBitmap DrawMessage(SKBitmap sectionImage, List<SKBitmap> imageLi
}
}
}
else if (new StringInfo(output).LengthInTextElements < output.Length)
else if (new StringInfo(output).LengthInTextElements < output.Length || !messageFont.ContainsGlyphs(output))
{
SKPaint renderFont = messageFont;
List<char> charList = new List<char>(output.ToArray());
Expand All @@ -624,7 +624,7 @@ public static SKBitmap DrawMessage(SKBitmap sectionImage, List<SKBitmap> imageLi

for (int j = 0; j < charList.Count; j++)
{
if (new StringInfo(charList[j].ToString()).LengthInTextElements == 0)
if (new StringInfo(charList[j].ToString()).LengthInTextElements == 0 || !renderFont.ContainsGlyphs(charList[j].ToString()))
{
if (messageBuffer != "")
sectionImage = DrawText(sectionImage, messageBuffer, messageFont, imageList, renderOptions, currentGifEmotes, canvasSize, ref drawPos, true, default_x);
Expand Down
2 changes: 1 addition & 1 deletion TwitchDownloaderCore/VideoDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ await Task.Run(() =>
StartInfo =
{
FileName = Path.GetFullPath(downloadOptions.FfmpegPath),
Arguments = String.Format("-y -avoid_negative_ts make_zero " + (downloadOptions.CropBeginning ? "-ss {1} " : "") + "-i \"{0}\" -analyzeduration {2} -probesize {2} " + (downloadOptions.CropEnding ? "-t {3} " : "") + "-c:v copy \"{4}\"", Path.Combine(downloadFolder, "output.ts"), (seekTime - startOffset).ToString(), Int32.MaxValue, seekDuration.ToString(), Path.GetFullPath(downloadOptions.Filename)),
Arguments = String.Format("-y -avoid_negative_ts make_zero -i \"{0}\" -analyzeduration {2} -probesize {2} -c:v copy \"{4}\"", Path.Combine(downloadFolder, "output.ts"), (seekTime - startOffset).ToString(), Int32.MaxValue, seekDuration.ToString(), Path.GetFullPath(downloadOptions.Filename)),
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardInput = false,
Expand Down

0 comments on commit a1fa85a

Please sign in to comment.