mirror of
https://github.com/greenshot/greenshot
synced 2025-07-30 19:50:11 -07:00
Making the initial stuff working, getting an installer, when running from VS.
This commit is contained in:
parent
a63bf734d4
commit
57e2044839
1023 changed files with 20896 additions and 19456 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Greenshot - a free and open source screenshot tool
|
||||
* Copyright (C) 2007-2016 Thomas Braun, Jens Klingen, Robin Krom
|
||||
* Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom
|
||||
*
|
||||
* For more information see: http://getgreenshot.org/
|
||||
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
|
@ -334,43 +334,41 @@ namespace Greenshot.Drawing
|
|||
FontStyle fontStyle = FontStyle.Regular;
|
||||
|
||||
bool hasStyle = false;
|
||||
using (var fontFamily = new FontFamily(fontFamilyName))
|
||||
using var fontFamily = new FontFamily(fontFamilyName);
|
||||
bool boldAvailable = fontFamily.IsStyleAvailable(FontStyle.Bold);
|
||||
if (fontBold && boldAvailable)
|
||||
{
|
||||
bool boldAvailable = fontFamily.IsStyleAvailable(FontStyle.Bold);
|
||||
if (fontBold && boldAvailable)
|
||||
{
|
||||
fontStyle |= FontStyle.Bold;
|
||||
hasStyle = true;
|
||||
}
|
||||
|
||||
bool italicAvailable = fontFamily.IsStyleAvailable(FontStyle.Italic);
|
||||
if (fontItalic && italicAvailable)
|
||||
{
|
||||
fontStyle |= FontStyle.Italic;
|
||||
hasStyle = true;
|
||||
}
|
||||
|
||||
if (!hasStyle)
|
||||
{
|
||||
bool regularAvailable = fontFamily.IsStyleAvailable(FontStyle.Regular);
|
||||
if (regularAvailable)
|
||||
{
|
||||
fontStyle = FontStyle.Regular;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (boldAvailable)
|
||||
{
|
||||
fontStyle = FontStyle.Bold;
|
||||
}
|
||||
else if (italicAvailable)
|
||||
{
|
||||
fontStyle = FontStyle.Italic;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Font(fontFamily, fontSize, fontStyle, GraphicsUnit.Pixel);
|
||||
fontStyle |= FontStyle.Bold;
|
||||
hasStyle = true;
|
||||
}
|
||||
|
||||
bool italicAvailable = fontFamily.IsStyleAvailable(FontStyle.Italic);
|
||||
if (fontItalic && italicAvailable)
|
||||
{
|
||||
fontStyle |= FontStyle.Italic;
|
||||
hasStyle = true;
|
||||
}
|
||||
|
||||
if (!hasStyle)
|
||||
{
|
||||
bool regularAvailable = fontFamily.IsStyleAvailable(FontStyle.Regular);
|
||||
if (regularAvailable)
|
||||
{
|
||||
fontStyle = FontStyle.Regular;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (boldAvailable)
|
||||
{
|
||||
fontStyle = FontStyle.Bold;
|
||||
}
|
||||
else if (italicAvailable)
|
||||
{
|
||||
fontStyle = FontStyle.Italic;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Font(fontFamily, fontSize, fontStyle, GraphicsUnit.Pixel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -592,12 +590,11 @@ namespace Greenshot.Drawing
|
|||
{
|
||||
shadowRect.Inflate(-textOffset, -textOffset);
|
||||
}
|
||||
using (Brush fontBrush = new SolidBrush(Color.FromArgb(alpha, 100, 100, 100)))
|
||||
{
|
||||
graphics.DrawString(text, font, fontBrush, shadowRect, stringFormat);
|
||||
currentStep++;
|
||||
alpha = alpha - basealpha / steps;
|
||||
}
|
||||
|
||||
using Brush fontBrush = new SolidBrush(Color.FromArgb(alpha, 100, 100, 100));
|
||||
graphics.DrawString(text, font, fontBrush, shadowRect, stringFormat);
|
||||
currentStep++;
|
||||
alpha -= basealpha / steps;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue