Ejemplo n.º 1
0
        public static YAlignmentEnum ToPdfClownAlignment(this AlinhamentoVertical av)
        {
            switch (av)
            {
            case AlinhamentoVertical.Topo:
                return(YAlignmentEnum.Top);

            case AlinhamentoVertical.Centro:
                return(YAlignmentEnum.Middle);

            case AlinhamentoVertical.Base:
                return(YAlignmentEnum.Bottom);
            }

            throw new InvalidOperationException();
        }
Ejemplo n.º 2
0
        public static AlinhamentoVertical RetornaAlinhamentoVerticalLD6(String alinhamento)
        {
            AlinhamentoVertical Result = AlinhamentoVertical.Centro;


            switch (alinhamento)
            {
            case "Abaixo":
                Result = Util.AlinhamentoVertical.Baixo;
                break;

            case "Centralizado":
                Result = AlinhamentoVertical.Centro;
                break;

            case "Acima":
                Result = AlinhamentoVertical.Cima;
                break;
            }

            return(Result);
        }
Ejemplo n.º 3
0
        internal void DrawString(string str, RectangleF rect, Fonte fonte, AlinhamentoHorizontal ah = AlinhamentoHorizontal.Esquerda, AlinhamentoVertical av = AlinhamentoVertical.Topo)
        {
            if (fonte == null)
            {
                throw new ArgumentNullException(nameof(fonte));
            }
            if (fonte.Tamanho <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(fonte));
            }
            CheckRectangle(rect);

            var p = rect.Location;

            if (av == AlinhamentoVertical.Base)
            {
                p.Y = rect.Bottom - fonte.AlturaLinha;
            }
            else if (av == AlinhamentoVertical.Centro)
            {
                p.Y += (rect.Height - fonte.AlturaLinha) / 2F;
            }

            if (ah == AlinhamentoHorizontal.Direita)
            {
                p.X = rect.Right - fonte.MedirLarguraTexto(str);
            }
            if (ah == AlinhamentoHorizontal.Centro)
            {
                p.X += (rect.Width - fonte.MedirLarguraTexto(str)) / 2F;
            }

            SetFont(fonte);
            ShowText(str, p);
        }