static public MPrintFont Get(int AD_PrintFont_ID) { int key = AD_PrintFont_ID; MPrintFont pf = (MPrintFont)_fonts[key]; if (pf == null) { pf = new MPrintFont(VAdvantage.Utility.Env.GetContext(), AD_PrintFont_ID, null); _fonts.Add(key, pf); } return(pf); } // get
/// <summary> /// Get header font /// </summary> /// <returns>font</returns> public Font GetHeader_Font() { if (header_Font != null) { return(header_Font); } int i = GetHdr_PrintFont_ID(); if (i != 0) { header_Font = MPrintFont.Get(i).GetFont(); } if (header_Font == null) { header_Font = new Font(standard_Font.Name, standard_Font.Size, FontStyle.Bold, GraphicsUnit.World); } return(header_Font); } // getHeader_Font
} // getPageHeader_Font /// <summary> /// Get funtion font /// </summary> /// <returns>font</returns> public Font GetFunct_Font() { if (funct_Font != null) { return(funct_Font); } int i = GetFunct_PrintFont_ID(); if (i != 0) { funct_Font = MPrintFont.Get(i).GetFont(); } if (funct_Font == null) { funct_Font = new Font(standard_Font.Name, standard_Font.Size, FontStyle.Bold | FontStyle.Italic, GraphicsUnit.World); } return(funct_Font); } // getFunct_Font
} // setFont public static MPrintFont Create(Font font) { MPrintFont pf = new MPrintFont(VAdvantage.Utility.Env.GetContext(), 0, null); StringBuilder name = new StringBuilder(font.Name); if (font.Style == FontStyle.Bold) { name.Append(" bold"); } if (font.Style == FontStyle.Italic) { name.Append(" italic"); } name.Append(" ").Append(font.Size); pf.SetName(name.ToString()); pf.SetFont(font); pf.Save(); return(pf); } // create
} // get static public MPrintTableFormat Get(Ctx ctx, int AD_PrintTableFormat_ID, int AD_PrintFont_ID) { return(Get(ctx, AD_PrintTableFormat_ID, MPrintFont.Get(AD_PrintFont_ID).GetFont())); } // get