public void setFeatures(Word.Application oApp, ClassFont oFont = null, String strNoChange = "(保持原值不变)") { app = oApp; try { doc = app.ActiveDocument; } catch (System.Exception ex) { doc = null; } finally { } m_strNoChange = strNoChange; if (oFont != null) { oFont.SelCopy2(inFont); // inFont.clone(oFont); } return; }
public Hashtable hshSectionPart = new Hashtable(); // k/v: name/sepParts public ClassWholeDocType() { for (int i = 0; i < 10; i++) { arrsHeadingTocFnt[i] = new ClassFont(); arrsHeadingTocParaFmt[i] = new ClassParagraphFormat(); } return; }
public void PaintTopInGame(ClipState clipState) { if (clipState != ClipState.BeforeClip || !ShowInTown && Hud.Game.Me.IsInTown || OnlyInGR && Hud.Game.SpecialArea != SpecialArea.GreaterRift) { return; } if (_size <= 0) { _size = HudWidth * SizeRatio; } var xPos = HudWidth * StartXPos; foreach (var player in Hud.Game.Players.OrderBy(p => p.HeroId)) { if (player.IsMe && !ShowSelf || !player.IsMe && ShowOnlyMe) { continue; } var found = false; var firstIter = true; foreach (var i in _skillOrder) { var skill = player.Powers.SkillSlots[i]; if (skill == null || !WatchedSnos.Contains(skill.SnoPower.Sno)) { continue; } found = true; if (firstIter) { var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + "\n(" + _classShorts[player.HeroClassDefinition.HeroClass] + ")"); ClassFont.DrawText(layout, xPos - (layout.Metrics.Width * 0.1f), HudHeight * StartYPos); firstIter = false; } var rect = new RectangleF(xPos, HudHeight * (StartYPos + 0.03f), _size, _size); SkillPainter.Paint(skill, rect); xPos += _size * 1.1f; } if (found) { xPos += _size * 1.1f; } } }
// 节,页眉页脚 ClassStyleStandards() { // headingTocFnts for (int i = 0; i < 9; i++) { headingTocFnts[i] = new ClassFont(); } // headingTocParaFmts for (int i = 0; i < 9; i++) { headingTocParaFmts[i] = new ClassParagraphFormat(); } // headingFonts for (int i = 0; i < 9; i++) { headingFonts[i] = new ClassFont(); } // headingParaFmts for (int i = 0; i < 9; i++) { headingParaFmts[i] = new ClassParagraphFormat(); } // headingListLevels for (int i = 0; i < 9; i++) { headingListLevels[i] = new ClassListLevel(); } // listParaFnts for (int i = 0; i < 9; i++) { listParaFnts[i] = new ClassFont(); } // listParaParaFmts for (int i = 0; i < 9; i++) { listParaParaFmts[i] = new ClassParagraphFormat(); } return; }
public ClassParagraphFormat m_paraFmt; // 段落信息类 public ClassHeadingStyle() { m_fnt = new ClassFont(); m_paraFmt = new ClassParagraphFormat(); int nInit = 0; m_fnt.AllCaps = nInit; // 保存字体同名参数信息 m_fnt.Animation = (Word.WdAnimation)nInit; //.wdAnimationNone;// 保存字体同名参数信息 m_fnt.Bold = nInit; // 保存字体同名参数信息 m_fnt.BoldBi = nInit; // 保存字体同名参数信息 m_fnt.Color = Word.WdColor.wdColorAutomatic; // 保存字体同名参数信息 m_fnt.ColorIndex = (Word.WdColorIndex)nInit; //.wdAuto;// 保存字体同名参数信息 m_fnt.ColorIndexBi = (Word.WdColorIndex)nInit; //.wdAuto;// 保存字体同名参数信息 m_fnt.DiacriticColor = Word.WdColor.wdColorAutomatic; // 保存字体同名参数信息 m_fnt.DisableCharacterSpaceGrid = false; // 保存字体同名参数信息 m_fnt.DoubleStrikeThrough = nInit; // 保存字体同名参数信息 m_fnt.Emboss = nInit; // 保存字体同名参数信息 m_fnt.EmphasisMark = Word.WdEmphasisMark.wdEmphasisMarkNone; // 保存字体同名参数信息 m_fnt.Engrave = nInit; // 保存字体同名参数信息 m_fnt.Hidden = nInit; // 保存字体同名参数信息 m_fnt.Italic = nInit; // 保存字体同名参数信息 m_fnt.ItalicBi = nInit; // 保存字体同名参数信息 m_fnt.NameBi = ""; // 保存字体同名参数信息 m_fnt.Outline = nInit; // 保存字体同名参数信息 m_fnt.Position = nInit; // 保存字体同名参数信息 m_fnt.Shadow = nInit; // 保存字体同名参数信息 m_fnt.SmallCaps = nInit; // 保存字体同名参数信息 m_fnt.Spacing = (float)nInit; // 保存字体同名参数信息 m_fnt.StrikeThrough = nInit; // 保存字体同名参数信息 m_fnt.Subscript = nInit; // 保存字体同名参数信息 m_fnt.Superscript = nInit; // 保存字体同名参数信息 m_fnt.Underline = Word.WdUnderline.wdUnderlineNone; // 保存字体同名参数信息 m_fnt.UnderlineColor = Word.WdColor.wdColorAutomatic; // 保存字体同名参数信息 m_fnt.DisableCharacterSpaceGrid = false; // 保存字体同名参数信息 // default m_fnt.NameFarEast = "宋体"; // 保存字体同名参数信息 m_fnt.NameAscii = "宋体"; // "+西文正文";// 保存字体同名参数信息 //m_fnt.NameOther = "+正文 CS 字体"; // "+西文正文";// 保存字体同名参数信息 m_fnt.Name = "宋体"; // 保存字体同名参数信息 m_fnt.Size = 10.0f; // 保存字体同名参数信息 m_fnt.Kerning = 1; // 保存字体同名参数信息 m_fnt.Scaling = 100; // 保存字体同名参数信息 // 保存段落同名参数信息 m_paraFmt.OutlineLevel = Word.WdOutlineLevel.wdOutlineLevelBodyText; // 保存段落同名参数信息 m_paraFmt.CharacterUnitFirstLineIndent = 2; // 保存段落同名参数信息 m_paraFmt.Alignment = Word.WdParagraphAlignment.wdAlignParagraphJustify; // 保存段落同名参数信息 m_paraFmt.Hyphenation = -1; // true// 保存段落同名参数信息 m_paraFmt.AutoAdjustRightIndent = -1; // true// 保存段落同名参数信息 m_paraFmt.FarEastLineBreakControl = -1; // true// 保存段落同名参数信息 m_paraFmt.WordWrap = -1; // true// 保存段落同名参数信息 m_paraFmt.HangingPunctuation = -1; // true// 保存段落同名参数信息 m_paraFmt.AddSpaceBetweenFarEastAndAlpha = -1; // true// 保存段落同名参数信息 m_paraFmt.AddSpaceBetweenFarEastAndDigit = -1; // true// 保存段落同名参数信息 m_paraFmt.LineSpacing = 12.0f; // 保存段落同名参数信息 m_paraFmt.BaseLineAlignment = Word.WdBaselineAlignment.wdBaselineAlignAuto; // 保存段落同名参数信息 m_paraFmt.ReadingOrder = Word.WdReadingOrder.wdReadingOrderLtr; // 保存段落同名参数信息 m_paraFmt.KeepTogether = 0; // 保存段落同名参数信息 m_paraFmt.KeepWithNext = -1; // 保存段落同名参数信息 m_paraFmt.SpaceAfter = 3.0f; // 保存段落同名参数信息 m_paraFmt.SpaceAfterAuto = 0; // 保存段落同名参数信息 m_paraFmt.SpaceBefore = 12.0f; // 保存段落同名参数信息 m_paraFmt.SpaceBeforeAuto = 0; // 保存段落同名参数信息 // m_bFntAssigned = false; // 初始化值 m_bParaFmtAssigned = false; // 初始化值 return; }
public void DrawStackCount(IPlayer player) { if (!player.Powers.BuffIsActive(Hud.Sno.SnoPowers.BaneOfTheStrickenPrimary.Sno, 0)) { return; } int count = Hud.Game.AliveMonsters.Count(m => m.SnoMonster.Priority == MonsterPriority.boss); if (count == 0) { return; } var uiBar = Hud.Render.MonsterHpBarUiElement; var monster = Hud.Game.SelectedMonster2 ?? Hud.Game.SelectedMonster1; if ((monster == null) || (uiBar == null) || (monster.SnoMonster.Priority != MonsterPriority.boss)) { return; } int HitnRng = 1; int _count = 0; _count = Hud.Game.AliveMonsters.Count(m => (player.FloorCoordinate.XYZDistanceTo(m.FloorCoordinate)) <= 10); if (_count < 1) { _count = 1; } Random rng; rng = new Random(Hud.Game.CurrentGameTick); HitnRng = rng.Next(1, _count); var w = uiBar.Rectangle.Height * 2; var h = uiBar.Rectangle.Height; var x = uiBar.Rectangle.Right + uiBar.Rectangle.Height * 5; var y = uiBar.Rectangle.Y + uiBar.Rectangle.Height * 0.3f; var bgTex = Hud.Texture.GetTexture(3166997520); var tex = Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.Unique_Gem_018_x1); var rect = new RectangleF(uiBar.Rectangle.Right + uiBar.Rectangle.Height * 5f + xPos, uiBar.Rectangle.Y - uiBar.Rectangle.Height * 1.5f / 6, uiBar.Rectangle.Height * 1.5f, uiBar.Rectangle.Height * 1.5f); var index = player.PortraitIndex; if (player.Powers.BuffIsActive(Hud.Sno.SnoPowers.BaneOfTheStrickenPrimary.Sno, 2)) { if (!cooling[index]) { cooling[index] = true; if (HitnRng == 1) { StackCount[index]++; } } } else { cooling[index] = false; } StackCountDecorator.TextFunc = () => StackCount[index].ToString(); StackBrush.DrawRectangle(rect); bgTex.Draw(rect.Left, rect.Top, rect.Width, rect.Height); tex.Draw(rect.Left, rect.Top, rect.Width, rect.Height); var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + "\n(" + classShorts[player.HeroClassDefinition.HeroClass] + ")"); if (DrawClassOnIcons || Hud.Window.CursorInsideRect(rect.X, rect.Y, rect.Width, rect.Height)) { ClassFont.DrawText(layout, x - (layout.Metrics.Width * 0.1f) + xPos, y - h * 3); } StackCountDecorator.Paint(x + xPos, y, w, h, HorizontalAlign.Center); xPos += rect.Width + h; }
public void PaintTopInGamePartyCooldownsPlugin(ClipState clipState) { if (clipState != ClipState.BeforeClip || !ShowInTown && Hud.Game.Me.IsInTown || OnlyInGR && Hud.Game.SpecialArea != SpecialArea.GreaterRift) { return; } if (_size <= 0) { _size = HudWidth * SizeRatio; } var xPos = HudWidth * StartXPos; foreach (var player in Hud.Game.Players.OrderBy(p => p.HeroId)) { // if (player.IsMe && !ShowSelf || !player.IsMe && ShowOnlyMe) continue; var foundCarrySkill = false; var flagIsFirstIterator = true; foreach (var i in _skillOrder) { double archonCooldown = 0; double archonTimeLeft = 0; var skill = player.Powers.SkillSlots[i]; if (skill == null || !WatchedSnos.Contains(skill.SnoPower.Sno)) { continue; } foundCarrySkill = true; if (skill != null && skill.SnoPower.Sno == 134872) { archonCooldown = (skill.CooldownFinishTick - Hud.Game.CurrentGameTick) / 60.0d; var archonBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Wizard_Archon.Sno); if (archonBuff != null) { archonTimeLeft = archonBuff.TimeLeftSeconds[2]; if (archonCooldown < 0) { if (skill.Rune == 3.0) { archonCooldown = skill.CalculateCooldown(100) - 20 + archonTimeLeft; } else { archonCooldown = skill.CalculateCooldown(120) - 20 + archonTimeLeft; } if (archonTimeLeft == 0) { archonCooldown = 0; } } } } if (flagIsFirstIterator) { var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + "\n(" + ((IsZDPS(player)) ? "Z" : "") + _classShortName[player.HeroClassDefinition.HeroClass] + ")"); ClassFont.DrawText(layout, xPos - (layout.Metrics.Width * 0.1f), HudHeight * StartYPos); flagIsFirstIterator = false; } if (skill != null && skill.SnoPower.Sno != 134872) { var rect = new SharpDX.RectangleF(xPos, HudHeight * (StartYPos + 0.03f), _size, _size); SkillPainter.Paint(skill, rect); } else if (skill != null && skill.SnoPower.Sno == 134872) { foreach (var iicon in Hud.Sno.SnoPowers.Wizard_Archon.Icons) { var Texture = Hud.Texture.GetTexture(iicon.TextureId); if (Texture != null) { Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size); } if (archonCooldown > 0.0) { var layout = ClassFont.GetTextLayout(archonCooldown.ToString("0.0") + "s"); ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2); } } } xPos += _size * 1.1f; } switch (player.HeroClassDefinition.HeroClass) { case HeroClass.WitchDoctor: var wdCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.WitchDoctor_Passive_SpiritVessel.Sno); if (wdCheatDeathBuff != null) { if (wdCheatDeathBuff.TimeLeftSeconds[1] > 0.0) { var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.WitchDoctor_Passive_SpiritVessel.Icons[1].TextureId); if (Texture != null) { Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size); } var layout = ClassFont.GetTextLayout(wdCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s"); ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2); xPos += _size * 1.1f; } } break; case HeroClass.Crusader: var crusaderCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Crusader_Passive_Indestructible.Sno); if (crusaderCheatDeathBuff != null) { if (crusaderCheatDeathBuff.TimeLeftSeconds[1] > 0.0) { var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Crusader_Passive_Indestructible.Icons[1].TextureId); if (Texture != null) { Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size); } var layout = ClassFont.GetTextLayout(crusaderCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s"); ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2); xPos += _size * 1.1f; } } break; case HeroClass.Barbarian: var barbarCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Barbarian_Passive_NervesOfSteel.Sno); if (barbarCheatDeathBuff != null) { if (barbarCheatDeathBuff.TimeLeftSeconds[1] > 0.0) { var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Barbarian_Passive_NervesOfSteel.Icons[1].TextureId); if (Texture != null) { Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size); } var layout = ClassFont.GetTextLayout(barbarCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s"); ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2); xPos += _size * 1.1f; } } break; case HeroClass.Monk: var monkCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Monk_Passive_NearDeathExperience.Sno); if (monkCheatDeathBuff != null) { if (monkCheatDeathBuff.TimeLeftSeconds[1] > 0.0) { var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Monk_Passive_NearDeathExperience.Icons[1].TextureId); if (Texture != null) { Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size); } var layout = ClassFont.GetTextLayout(monkCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s"); ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2); xPos += _size * 1.1f; } } break; case HeroClass.Necromancer: var necCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Necromancer_Passive_FinalService.Sno); if (necCheatDeathBuff != null) { if (necCheatDeathBuff.TimeLeftSeconds[1] > 0.0) { var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Necromancer_Passive_FinalService.Icons[1].TextureId); if (Texture != null) { Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size); } var layout = ClassFont.GetTextLayout(necCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s"); ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2); xPos += _size * 1.1f; } } break; case HeroClass.DemonHunter: var dhCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.DemonHunter_Passive_Awareness.Sno); if (dhCheatDeathBuff != null) { if (dhCheatDeathBuff.TimeLeftSeconds[1] > 0.0) { var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.DemonHunter_Passive_Awareness.Icons[1].TextureId); if (Texture != null) { Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size); } var layout = ClassFont.GetTextLayout(dhCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s"); ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2); xPos += _size * 1.1f; } } break; case HeroClass.Wizard: var wizCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Wizard_Passive_UnstableAnomaly.Sno); if (wizCheatDeathBuff != null) { if (wizCheatDeathBuff.TimeLeftSeconds[1] > 0.0) { var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Wizard_Passive_UnstableAnomaly.Icons[1].TextureId); if (Texture != null) { Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size); } var layout = ClassFont.GetTextLayout(wizCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s"); ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2); xPos += _size * 1.1f; } } break; } if (foundCarrySkill) { xPos += _size * 1.1f; } } }
public void PaintTopInGame(ClipState clipState) { if (clipState != ClipState.BeforeClip) { return; } var xPos = HudWidth * StartXPos; var index = 0; foreach (var player in Hud.Game.Players.OrderBy(p => p.HeroClassDefinition.HeroClass)) { var foundCarrySkill = false; var flagIsFirstIterator = true; var yPos = HudHeight * StartYPos; foreach (var skill in player.Powers.UsedSkills.OrderBy(p => p.SnoPower.Sno)) { if (skill == null || !WatchedSnos.Contains(skill.SnoPower.Sno)) { continue; } foundCarrySkill = true; if (flagIsFirstIterator) { var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + _classShortName[player.HeroClassDefinition.HeroClass]); ClassFont.DrawText(layout, xPos, yPos); flagIsFirstIterator = false; yPos += 0.035f * HudHeight; } var rect = new SharpDX.RectangleF(xPos, yPos, _size, _size); SkillPainter.Paint(skill, rect); yPos += _size * 1.1f; } var CheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.WitchDoctor_Passive_SpiritVessel.Sno); switch (player.HeroClassDefinition.HeroClass) { case HeroClass.Necromancer: CheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Necromancer_Passive_FinalService.Sno); break; case HeroClass.Wizard: CheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Wizard_Passive_UnstableAnomaly.Sno); break; } if (CheatDeathBuff != null && CheatDeathBuff.TimeLeftSeconds[1] > 0.0) { if (flagIsFirstIterator) { var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + _classShortName[player.HeroClassDefinition.HeroClass]); ClassFont.DrawText(layout, xPos, yPos); foundCarrySkill = true; yPos += 0.03f * HudHeight; } var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.WitchDoctor_Passive_SpiritVessel.Icons[1].TextureId); switch (player.HeroClassDefinition.HeroClass) { case HeroClass.Necromancer: Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Necromancer_Passive_FinalService.Icons[1].TextureId); break; case HeroClass.Wizard: Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Wizard_Passive_UnstableAnomaly.Icons[1].TextureId); break; } if (Texture != null) { Texture.Draw(xPos, yPos, _size, _size); } var layout2 = ClassFont.GetTextLayout(CheatDeathBuff.TimeLeftSeconds[1].ToString("0")); ClassFont.DrawText(layout2, xPos + (_size - (float)Math.Ceiling(layout2.Metrics.Width)) / 2, yPos + (_size - layout2.Metrics.Height) / 2); } if (foundCarrySkill) { xPos += _size * 2.5f; } index++; } }
private void Data2UI(ClassFont oFont = null) { if (oFont != null) { oFont.SelCopy2(inFont); } if (inFont.isSet(ClassFont.euMembers.NameFarEast)) { cmbChineseFonts.Text = inFont.NameFarEast; } else { cmbChineseFonts.Text = m_strNoChange; } if (inFont.isSet(ClassFont.euMembers.NameAscii)) { cmbAsciiFonts.Text = inFont.NameAscii; } else { cmbAsciiFonts.Text = m_strNoChange; } if (inFont.isSet(ClassFont.euMembers.Size)) { cmbFontSize.Text = "" + inFont.Size; } else { cmbFontSize.Text = m_strNoChange; } // if (inFont.isSet(ClassFont.euMembers.Bold)) { if (inFont.Bold != 0) // true { chkFontBold.CheckState = CheckState.Checked; } else { chkFontBold.CheckState = CheckState.Unchecked; } } else { chkFontBold.CheckState = CheckState.Indeterminate; } // if (inFont.isSet(ClassFont.euMembers.Italic)) { if (inFont.Italic != 0) // true { chkFontItalic.CheckState = CheckState.Checked; } else { chkFontItalic.CheckState = CheckState.Unchecked; } } else { chkFontItalic.CheckState = CheckState.Indeterminate; } return; }
// 复制到自定义FONT的参数 public void copy2(ClassFont fnt) { fnt.AllCaps = this.AllCaps; // 复制到自定义FONT的参数 fnt.Animation = (Word.WdAnimation) this.Animations; // wdAnimationNone// 复制到自定义FONT的参数 fnt.Bold = this.Bold; // 复制到自定义FONT的参数 fnt.BoldBi = this.BoldBi; // 复制到自定义FONT的参数 int nTmp = 0; fnt.Color = WdColor.wdColorAutomatic;// 复制到自定义FONT的参数 if (int.TryParse(this.ColorRGB, out nTmp)) { fnt.Color = (WdColor)nTmp;// 复制到自定义FONT的参数 } fnt.DoubleStrikeThrough = this.DoubleStrikeThrough; // 复制到自定义FONT的参数 fnt.Emboss = this.Emboss; // 复制到自定义FONT的参数 fnt.Engrave = this.Engrave; // 复制到自定义FONT的参数 fnt.NameAscii = this.FontHighAnsi; //"Arial Unicode MS"// 复制到自定义FONT的参数 //fnt.NameOther = this.FontLowAnsi;//"Arial Unicode MS"// 复制到自定义FONT的参数 fnt.NameFarEast = this.FontMajor; //"微软雅黑"// 复制到自定义FONT的参数 fnt.Name = this.FontMajor; // 复制到自定义FONT的参数 fnt.Hidden = this.Hidden; // 复制到自定义FONT的参数 fnt.Italic = this.Italic; // 复制到自定义FONT的参数 fnt.ItalicBi = this.ItalicBi; // 复制到自定义FONT的参数 if (this.Kerning > 0) { if (m_hashPointsDialog2Size.Contains(this.KerningMin)) { fnt.Kerning = (float)m_hashPointsDialog2Size[this.KerningMin];// this.point// 复制到自定义FONT的参数 } else { if (float.TryParse(this.KerningMin, out fnt.Kerning)) { } else { fnt.Kerning = 0.0f;// 复制到自定义FONT的参数 } } } else { fnt.Kerning = this.Kerning; // 0.0f// 复制到自定义FONT的参数 } fnt.Outline = this.Outline; // 复制到自定义FONT的参数 if (int.TryParse(this.Position, out nTmp)) // 复制到自定义FONT的参数 { fnt.Position = nTmp; // 复制到自定义FONT的参数 } else { fnt.Position = nTmp;// 复制到自定义FONT的参数 } if (int.TryParse(this.Scale.Replace("%", ""), out nTmp)) // 复制到自定义FONT的参数 { fnt.Scaling = nTmp; // 复制到自定义FONT的参数 } else { fnt.Scaling = 100;// 复制到自定义FONT的参数 } fnt.Shadow = this.Shadow; // 复制到自定义FONT的参数 fnt.SmallCaps = this.SmallCaps; // 复制到自定义FONT的参数 float fTmp = 0.0f; if (float.TryParse(this.Spacing, out fTmp)) // 复制到自定义FONT的参数 { fnt.Spacing = fTmp; // 复制到自定义FONT的参数 } else { fnt.Spacing = 0.0f;// 复制到自定义FONT的参数 } fnt.StrikeThrough = this.StrikeThrough; // 复制到自定义FONT的参数 fnt.Subscript = this.Subscript; // 复制到自定义FONT的参数 fnt.Superscript = this.Superscript; // 复制到自定义FONT的参数 fnt.UnderlineColor = WdColor.wdColorAutomatic; // 复制到自定义FONT的参数 if (int.TryParse(this.UnderlineColor, out nTmp)) // 复制到自定义FONT的参数 { fnt.UnderlineColor = (WdColor)nTmp; // 复制到自定义FONT的参数 } fnt.Underline = WdUnderline.wdUnderlineNone; // 复制到自定义FONT的参数 if (m_hashUnderlineDialog2WordFont.Contains(this.Underline)) // 复制到自定义FONT的参数 { fnt.Underline = (WdUnderline)m_hashUnderlineDialog2WordFont[this.Underline]; // wdUnderlineNone } if (m_hashPointsDialog2Size.Contains(this.Points)) // 复制到自定义FONT的参数 { fnt.Size = (float)m_hashPointsDialog2Size[this.Points]; // this.point } else { float.TryParse(this.Points, out fnt.Size);// 复制到自定义FONT的参数 } if (m_hashPointsDialog2Size.Contains(this.PointsBi)) // 复制到自定义FONT的参数 { fnt.SizeBi = (float)m_hashPointsDialog2Size[this.PointsBi]; // this.PointsBi } else { float.TryParse(this.PointsBi, out fnt.SizeBi);// 复制到自定义FONT的参数 } fnt.DisableCharacterSpaceGrid = (this.CharacterWidthGrid != 0);// 复制到自定义FONT的参数 return; }
// 复制ClassFONT的参数 public void clone(ClassFont cFnt) { // if (cFnt.Name.Equals("")) // return; this.AllCaps = cFnt.AllCaps; // 复制ClassFONT的参数 this.Animations = (int)cFnt.Animation; // wdAnimationNone,// 复制ClassFONT的参数 this.Bold = cFnt.Bold; // 复制ClassFONT的参数 this.ColorRGB = "" + (int)cFnt.Color; // wdColorAutomatic,// 复制ClassFONT的参数 this.DoubleStrikeThrough = cFnt.DoubleStrikeThrough; // 复制ClassFONT的参数 this.Emboss = cFnt.Emboss; // 复制ClassFONT的参数 this.Engrave = cFnt.Engrave; // 复制ClassFONT的参数 this.FontHighAnsi = cFnt.NameAscii; //"Arial Unicode MS",// 复制ClassFONT的参数 //this.FontLowAnsi = cFnt.NameOther;//"Arial Unicode MS",// 复制ClassFONT的参数 this.FontMajor = cFnt.NameFarEast; //"微软雅黑",// 复制ClassFONT的参数 this.Font = cFnt.Name; // 复制ClassFONT的参数 this.Hidden = cFnt.Hidden; // 复制ClassFONT的参数 this.Italic = cFnt.Italic; // 复制ClassFONT的参数 if (m_hashPointsSize2Dialog.Contains(cFnt.Kerning)) // 复制ClassFONT的参数 { this.Kerning = 1; // 复制ClassFONT的参数 this.KerningMin = (String)m_hashPointsSize2Dialog[cFnt.Kerning]; // this.Kerning,// 复制ClassFONT的参数 } else { this.Kerning = 0; // 复制ClassFONT的参数 this.KerningMin = ""; // 复制ClassFONT的参数 } this.Outline = cFnt.Outline; // 复制ClassFONT的参数 this.Position = cFnt.Position + " 磅"; // 复制ClassFONT的参数 this.Scale = cFnt.Scaling + "%"; // 复制ClassFONT的参数 this.Shadow = cFnt.Shadow; // 复制ClassFONT的参数 this.SmallCaps = cFnt.SmallCaps; // 复制ClassFONT的参数 this.Spacing = cFnt.Spacing + " 磅"; // 复制ClassFONT的参数 this.StrikeThrough = cFnt.StrikeThrough; // 复制ClassFONT的参数 this.Subscript = cFnt.Subscript; // 复制ClassFONT的参数 this.Superscript = cFnt.Superscript; // 复制ClassFONT的参数 this.UnderlineColor = "" + (int)cFnt.UnderlineColor; // wdColorAutomatic,// 复制ClassFONT的参数 this.Underline = (int)WdUnderline.wdUnderlineNone; // 复制ClassFONT的参数 if (m_hashUnderlineWordFont2Dialog.Contains(cFnt.Underline)) // 复制ClassFONT的参数 { this.Underline = (int)m_hashUnderlineWordFont2Dialog[cFnt.Underline]; // wdUnderlineNone,// 复制ClassFONT的参数 } if (m_hashPointsSize2Dialog.Contains(cFnt.Size)) // 复制ClassFONT的参数 { this.Points = (String)m_hashPointsSize2Dialog[cFnt.Size]; // cFnt.point,// 复制ClassFONT的参数 } else { this.Points = "" + cFnt.Size;// 复制ClassFONT的参数 } this.CharacterWidthGrid = (cFnt.DisableCharacterSpaceGrid ? 1:0);// 复制ClassFONT的参数 //this.Color = cFnt.ColorDialog; //this.PointsBi = "11"; return; }