This commit is contained in:
parent
052ae3d424
commit
b76d2a0c46
@ -88,11 +88,17 @@ namespace fmtxml
|
||||
}
|
||||
private const string _TripleBang = "\xAD\xAD\xAD\xA8\xA8";
|
||||
Regex regLines = new Regex(@"([^\r\n]*)?\r?\n", RegexOptions.Singleline);
|
||||
|
||||
// If processing any of the RGE (except RGEDEV) C0 macros, adjust the x location of the ellipse, so that
|
||||
// 32bit printing matches 16bit. This flag shows that we're in a format that needs this adjustment.
|
||||
private static bool _InRge = false;
|
||||
private static bool _DoingRgeC0 = false;
|
||||
private string CreateSvg(FileInfo file, string buff)
|
||||
{
|
||||
IsGenMac = (buff.Substring(0, 5) == _TripleBang);
|
||||
if(!IsGenMac)
|
||||
return null;
|
||||
_InRge = (file.Name.ToUpper().Contains("RGE") && !file.Name.ToUpper().Contains("RGEDEV"));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
MatchCollection lines = regLines.Matches(buff);
|
||||
bool svg = false;
|
||||
@ -107,9 +113,15 @@ namespace fmtxml
|
||||
else
|
||||
AddSvgSuffix(sb, hasC0);
|
||||
else if (text.StartsWith("\xAD\xAD"))
|
||||
{
|
||||
hasC0 |= AddGroupStart(sb, ref group, text).ToLower() == "c0";
|
||||
_DoingRgeC0 = (hasC0 && _InRge);
|
||||
}
|
||||
else if (text == "END")
|
||||
{
|
||||
group = AddGroupEnd(sb, group);
|
||||
_DoingRgeC0 = false;
|
||||
}
|
||||
else if (text != "")
|
||||
ProcessCommand(sb, text, file);
|
||||
}
|
||||
@ -249,7 +261,7 @@ namespace fmtxml
|
||||
// add in the radius to the 'y' to get the correct value.
|
||||
float yadj = TwipsToPointsEllipse(ellipseMatch.Groups[4].Value);
|
||||
sb.Append(string.Format(" <ellipse cx=\"{0}\" cy=\"{1}\" rx=\"{2}\" ry=\"{3}\" fill=\"none\" stroke=\"black\" stroke-width=\"{4}\" />\r\n",
|
||||
TwipsToPointsX(ellipseMatch.Groups[1].Value),
|
||||
_DoingRgeC0?6.5:TwipsToPointsX(ellipseMatch.Groups[1].Value),
|
||||
yadj + TwipsToPointsY(ellipseMatch.Groups[2].Value),
|
||||
TwipsToPointsEllipse(ellipseMatch.Groups[3].Value),
|
||||
TwipsToPointsEllipse(ellipseMatch.Groups[4].Value),
|
||||
|
Loading…
x
Reference in New Issue
Block a user