private bool Write(CenteredTextElement centered) { if (centered == null) { return(false); } float widthInPoints = PageSettings.InPoints(_settings.WritablePageWidth()); string[] lines = BreakIntoLines(centered.Content.ToString(), widthInPoints); if (!HaveRoomFor(lines.Length)) { NewPage(); } WriteContentNode(centered.Content, widthInPoints, (x) => (widthInPoints - x) / 2, null); EmptyLine(); return(true); }
private bool Write(CenteredTextElement centered) { if (centered == null) return false; float widthInPoints = PageSettings.InPoints(_settings.WritablePageWidth()); string[] lines = BreakIntoLines(centered.Content.ToString(), widthInPoints); if (!HaveRoomFor(lines.Length)) NewPage(); WriteContentNode(centered.Content, widthInPoints, (x) => (widthInPoints - x) / 2, null ); EmptyLine(); return true; }