public void DefaultTextScaling_OneColFullPgStdBibleSize()
        {
            m_pub.Name                      = "Scripture Draft";
            m_pub.BaseFontSize              = 0;
            m_pub.BaseLineSpacing           = 0;
            m_pub.PaperHeight               = (int)(8.7 * 72000);
            m_pub.PaperWidth                = (int)(5.8 * 72000);
            m_pub.PageHeight                = 0;
            m_pub.PageWidth                 = 0;
            m_pub.DivisionsOS[0].NumColumns = 1;
            IVwStylesheet stylesheet;
            int           nVar;

            using (DummyScripturePublication scrPub = DummyScripturePublication.Create(m_pub,
                                                                                       TeViewType.Scripture | TeViewType.PrintLayout, m_realStylesheet))
            {
                stylesheet = scrPub.StyleSheet;
                ITsTextProps ttpNormalPara = stylesheet.GetStyleRgch(0, ScrStyleNames.NormalParagraph);
                // We expect that the normal style will be bumped up to the official IPUB sizes for
                // a one-column publication.
                Assert.AreEqual(11000,
                                ttpNormalPara.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
                Assert.AreEqual(-13000,
                                ttpNormalPara.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            }

            // We expect that these styles that have specific font sizes will have their original values.
            ITsTextProps styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);

            Assert.AreEqual(10000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(9000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(10000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(22000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));

            // We expect that these styles with specific line heights will have their original values.
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.NormalFootnoteParagraph);
            Assert.AreEqual(10833, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);
            Assert.AreEqual(-11917, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(-10833, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(-26000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));

            // We expect that these styles will have their original space before/after at values.
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(39000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(13000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(8667, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(4333, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
        }
        public void NoTextScaling()
        {
            // Set up a ScripturePublication with no scaling specified.
            m_pub.Name                      = "Scripture Draft";
            m_pub.BaseFontSize              = 0;
            m_pub.BaseLineSpacing           = 0;
            m_pub.PageHeight                = 0;
            m_pub.PageWidth                 = 0;
            m_pub.PaperHeight               = 0;
            m_pub.PaperWidth                = 0;
            m_pub.DivisionsOS[0].NumColumns = 2;
            IVwStylesheet stylesheet;
            int           nVar;

            using (DummyScripturePublication scrPub = DummyScripturePublication.Create(m_pub,
                                                                                       TeViewType.Scripture | TeViewType.PrintLayout, m_realStylesheet))
            {
                stylesheet = scrPub.StyleSheet;
                ITsTextProps ttpNormalPara = stylesheet.GetStyleRgch(0, ScrStyleNames.NormalParagraph);
                // We expect that the normal style will be unchanged.
                Assert.AreEqual(10000,
                                ttpNormalPara.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
                Assert.AreEqual(-12000,
                                ttpNormalPara.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            }

            // We expect that these styles that have specific font sizes will have their original values.
            ITsTextProps styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);

            Assert.AreEqual(9000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(8000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(9000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(20000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));

            // We expect that these styles with specific line heights will have their original values.
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.NormalFootnoteParagraph);
            Assert.AreEqual(10000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);
            Assert.AreEqual(-11000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(-10000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(-24000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));

            // We expect that these styles will have their original space before/after at values.
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(36000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(12000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(8000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(4000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
        }
        public void CorrectionPrintoutLineSpacing()
        {
            // Set up a ScripturePublication with no scaling specified.
            m_pub.BaseFontSize    = 12000;
            m_pub.BaseLineSpacing = -36000;
            IVwStylesheet stylesheet;
            int           nVar;

            using (DummyScripturePublication scrPub = DummyScripturePublication.Create(m_pub,
                                                                                       TeViewType.Correction, m_realStylesheet))
            {
                stylesheet = scrPub.StyleSheet;
                ITsTextProps ttpNormalPara = stylesheet.GetStyleRgch(0, ScrStyleNames.NormalParagraph);
                // We expect that the normal style will have specified settings for the publication.
                Assert.AreEqual(12000,
                                ttpNormalPara.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
                Assert.AreEqual(-36000,
                                ttpNormalPara.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            }

            // We expect that these styles will be overridden for font size at 120% their original size.
            ITsTextProps styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);

            Assert.AreEqual(11000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(10000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(11000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(24000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));

            // We expect these styles to be overridden for line spacing to exactly 36 pts.
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.NormalFootnoteParagraph);
            Assert.AreEqual(-36000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);
            Assert.AreEqual(-36000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(-36000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(-36000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));

            // We expect that these styles will have unchanged space before/after values.
            // REVIEW: Should we zero out any space before or after for the correction printout view to
            // achieve consistent line spacing?
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(36000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(12000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(8000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(4000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
        }
        public void SmallTextScaling()
        {
            // Set up a ScripturePublication of 4 on 6 pts (base character size on line spacing).
            m_pub.BaseFontSize    = 4000;
            m_pub.BaseLineSpacing = -6000;
            InMemoryStyleSheet stylesheet;
            int nVar;

            using (DummyScripturePublication scrPub = DummyScripturePublication.Create(m_pub,
                                                                                       TeViewType.Scripture | TeViewType.PrintLayout, m_realStylesheet))
            {
                stylesheet = scrPub.StyleSheet as InMemoryStyleSheet;
                Assert.IsNotNull(stylesheet);

                ITsTextProps ttpNormalPara = stylesheet.GetStyleRgch(0, ScrStyleNames.NormalParagraph);
                // We expect that the normal style will have specified settings for the publication.
                Assert.AreEqual(4000,
                                ttpNormalPara.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
                Assert.AreEqual(-6000,
                                ttpNormalPara.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            }

            // We expect that these styles will be overridden for font size at 40% their original size.
            ITsTextProps styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);

            Assert.AreEqual(4000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(4000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(4000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(8000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));

            // We expect that these styles will be overridden for line spacing at 50% their original size.
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.NormalFootnoteParagraph);
            Assert.AreEqual(5000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);
            Assert.AreEqual(-5500, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(-5000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(-12000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));

            // We expect that these styles will be overridden for space before/after at 50% their original size.
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(18000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(6000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(4000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(2000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
        }
        public void LargeTextScaling()
        {
            // Set up a ScripturePublication of 14 on 16 pts (base character size on line spacing).
            // (Original size is for 10 on 12).
            m_pub.BaseFontSize    = 14000;
            m_pub.BaseLineSpacing = -16000;
            IVwStylesheet stylesheet;
            int           nVar;

            using (DummyScripturePublication scrPub = DummyScripturePublication.Create(m_pub,
                                                                                       TeViewType.Scripture | TeViewType.PrintLayout, m_realStylesheet))
            {
                stylesheet = scrPub.StyleSheet;
                ITsTextProps ttpNormalPara = stylesheet.GetStyleRgch(0, ScrStyleNames.NormalParagraph);
                // We expect that the normal style will have specified settings for the publication.
                Assert.AreEqual(14000,
                                ttpNormalPara.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
                Assert.AreEqual(-16000,
                                ttpNormalPara.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            }

            // We expect that these styles will be overridden for font size at 140% their original size.
            ITsTextProps styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);

            Assert.AreEqual(13000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(11000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(13000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(28000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));

            // We expect that these styles will be overridden for font size at 133% their original size
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.NormalFootnoteParagraph);
            Assert.AreEqual(13333, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);
            Assert.AreEqual(-14667, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(-13333, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(-32000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));

            // We expect that these styles will be overridden for space before/after at 133% their original size.
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(48000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(16000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(10667, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(5333, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
        }
        public void HugeTextScaling()
        {
            // Set up a ScripturePublication of 4 on 6 pts (base character size on line spacing).
            m_pub.BaseFontSize    = 120000;
            m_pub.BaseLineSpacing = -120020;
            IVwStylesheet stylesheet;
            int           nVar;

            using (DummyScripturePublication scrPub = DummyScripturePublication.Create(m_pub,
                                                                                       TeViewType.Scripture | TeViewType.PrintLayout, m_realStylesheet))
            {
                stylesheet = scrPub.StyleSheet;
                ITsTextProps ttpNormalPara = scrPub.StyleSheet.GetStyleRgch(0, ScrStyleNames.NormalParagraph);
                // We expect that the normal style will have specified settings for the publication.
                Assert.AreEqual(120000,
                                ttpNormalPara.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            }

            // We expect that these styles will be overridden for font size at 1200% their original size
            // (except where they would go above the maximum size).
            ITsTextProps styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);

            Assert.AreEqual(108000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(96000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(108000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(240000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));

            // We expect these styles to be overridden for line spacing at 1000.1667% their original size.
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.NormalFootnoteParagraph);
            Assert.AreEqual(100017, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);
            Assert.AreEqual(-110018, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(-100017, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(-240040, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));

            // We expect that these styles will be overridden for space before/after at 1000.1667% their original size.
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(360060, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(120020, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(80013, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(40007, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
        }
示例#7
0
        public void NormalTextScaling()
        {
            // Set up a ScripturePublication of 9 on 11 pts (base character size on line spacing).
            m_pub.BaseFontSize    = 9000;
            m_pub.BaseLineSpacing = -11000;
            DummyScripturePublication scrPub = DummyScripturePublication.Create(m_pub,
                                                                                TeViewType.Scripture | TeViewType.PrintLayout, m_realStylesheet);
            IVwStylesheet stylesheet    = scrPub.StyleSheet;
            ITsTextProps  ttpNormalPara = stylesheet.GetStyleRgch(0, ScrStyleNames.NormalParagraph);
            int           nVar;

            // We expect that the normal style will have specified settings for the publication.
            Assert.AreEqual(9000,
                            ttpNormalPara.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            Assert.AreEqual(-11000,
                            ttpNormalPara.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            scrPub.Dispose();

            // We expect that these styles will be overridden for font size at 90% their original size.
            ITsTextProps styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);

            Assert.AreEqual(8000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(7000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(8000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(18000, styleProps.GetIntPropValues((int)FwTextPropType.ktptFontSize, out nVar));

            // We expect these styles to be overridden for line spacing at 91.667% their original size.
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.NormalFootnoteParagraph);
            Assert.AreEqual(9167, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroParagraph);
            Assert.AreEqual(-10083, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.IntroSectionHead);
            Assert.AreEqual(-9167, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(-22000, styleProps.GetIntPropValues((int)FwTextPropType.ktptLineHeight, out nVar));

            // We expect that these styles will be overridden for space before/after at 91.667% their original size.
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(33000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.MainBookTitle);
            Assert.AreEqual(11000, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(7333, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceBefore, out nVar));
            styleProps = stylesheet.GetStyleRgch(0, ScrStyleNames.SectionHead);
            Assert.AreEqual(3667, styleProps.GetIntPropValues((int)FwTextPropType.ktptSpaceAfter, out nVar));
        }
示例#8
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Method to test creation of a publication view.
		/// </summary>
		/// <param name="pub">The publication.</param>
		/// <param name="viewType">Type of the Translation Editor view.</param>
		/// <returns>
		/// a Scripture publication for the specified view type.
		/// </returns>
		/// ------------------------------------------------------------------------------------
		internal static DummyScripturePublication Create(IPublication pub,
			TeViewType viewType, FwStyleSheet stylesheet)
		{
			if (viewType == TeViewType.BackTranslationParallelPrint)
			{
				Debug.Assert(false, "Not yet implemented.");
				return null;
			}

			DummyScripturePublication pubControl = new DummyScripturePublication(pub.Cache,
				stylesheet, 567, pub, viewType, DateTime.Now);
			pubControl.Anchor = AnchorStyles.Top | AnchorStyles.Left |
				AnchorStyles.Right | AnchorStyles.Bottom;
			pubControl.Dock = DockStyle.Fill;
			pubControl.Name = TeEditingHelper.ViewTypeString(viewType);
			pubControl.Visible = false;
			return pubControl;
		}
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Method to test creation of a publication view.
        /// </summary>
        /// <param name="pub">The publication.</param>
        /// <param name="viewType">Type of the Translation Editor view.</param>
        /// <returns>
        /// a Scripture publication for the specified view type.
        /// </returns>
        /// ------------------------------------------------------------------------------------
        internal static DummyScripturePublication Create(IPublication pub,
                                                         TeViewType viewType, FwStyleSheet stylesheet)
        {
            if (viewType == TeViewType.BackTranslationParallelPrint)
            {
                Debug.Assert(false, "Not yet implemented.");
                return(null);
            }

            DummyScripturePublication pubControl = new DummyScripturePublication(pub.Cache,
                                                                                 stylesheet, 567, pub, viewType, DateTime.Now);

            pubControl.Anchor = AnchorStyles.Top | AnchorStyles.Left |
                                AnchorStyles.Right | AnchorStyles.Bottom;
            pubControl.Dock    = DockStyle.Fill;
            pubControl.Name    = TeEditingHelper.ViewTypeString(viewType);
            pubControl.Visible = false;
            return(pubControl);
        }