Exemplo n.º 1
0
        public void Compose()
        {
            //if (_paralst?.Count == 0 ) return;
            if (isValid() != true)
            {
                return;
            }

            int devw = _tateviewWidth;
            int devh = _tateviewHeight;
            //1.Compose
            float fntSz = 24;

            if (_isFontSizeLarge == true)
            {
                fntSz += 24;
            }
            //float gyokanSz = fntSz * 0.5f;
            float gyokanSz = fntSz * 1.0f;

            if (_isVisibleHinshi == true)
            {
                gyokanSz += fntSz * 1.0f;
            }
            float      mg   = 10; //デバイスに対しての余白
            HKComposer comp = new HKComposer();

            comp.FontSize   = fntSz;
            comp.GyokanSize = gyokanSz;
            comp.Init((float)devw - mg * 2, (float)devh - mg * 2);
            _lnlst.Clear();
            comp.Compose(_paralst, ref _lnlst);

            //2.Page一覧
            _pglst.Clear();
            HKPageCreate.CreatePageList((float)devw - mg * 2, fntSz, _lnlst, ref _pglst);

            //3.Deviceの値に変換
            HKDevice dev = new HKDevice();

            dev.setup(fntSz, (float)devw, (float)devh, mg, mg, mg, mg);
            dev.calcToDevice(ref _pglst);

            CurrentPage = _pglst[0];
            PageNum     = _pglst.Count;
        }
Exemplo n.º 2
0
        public static IList <IHKWaxPage> createTestCalcDevice(string buf,
                                                              float fntsz, float gyokan,
                                                              float view_w, float view_h,
                                                              float mg_lft, float mg_rgt, float mg_top)
        {
            List <HKWaxLine> lnlst = WaxComposerTest.createTestWaxLineList(buf, view_w, view_h, fntsz, gyokan);

            //HKPageCreate page = new HKPageCreate();
            IList <IHKWaxPage> pglst = new List <IHKWaxPage>();

            HKPageCreate.CreatePageList(view_w, fntsz, lnlst, ref pglst);

            HKDevice dev = new HKDevice();

            dev.setup(fntsz, view_w + mg_lft + mg_rgt, view_h, mg_lft, mg_top, mg_rgt, 0);
            dev.calcToDevice(ref pglst);
            return(pglst);
        }
Exemplo n.º 3
0
        /// <summary>
        /// ページを組版
        /// </summary>
        public void Compose(bool isForce = false)
        {
            if (isForce != true && IsValid() != true)
            {
                return;
            }

            PageIndex = 0;
            double devw = TateviewWidth;
            double devh = TateviewHeight;
            //1.Compose
            float fntSz = FontSize;

            if (IsFontSizeLarge == true)
            {
                fntSz += 24;
            }
            //float gyokanSz = fntSz * 0.5f;
            float      gyokanSz = fntSz * 1.0f;
            float      mg       = 10; //デバイスに対しての余白
            HKComposer comp     = new HKComposer();

            comp.FontSize   = fntSz;
            comp.GyokanSize = gyokanSz;
            comp.Init((float)devw - mg * 2, (float)devh - mg * 2);
            _lnlst.Clear();
            comp.Compose(_paralst, ref _lnlst);

            //2.Page一覧
            PageList.Clear();
            var pglst = PageList;

            HKPageCreate.CreatePageList((float)devw - mg * 2, fntSz, _lnlst, ref pglst);

            //3.Deviceの値に変換
            HKDevice dev = new HKDevice();

            dev.setup(fntSz, (float)devw, (float)devh, mg, mg, mg, mg);
            dev.calcToDevice(ref pglst);

            PageNum = PageList.Count;
        }