Class: HPDFFont
- Inherits:
-
Object
- Object
- HPDFFont
- Defined in:
- ext/hpdf.c
Instance Method Summary collapse
- #get_ascent ⇒ Object
- #get_bbox ⇒ Object
- #get_cap_height ⇒ Object
- #get_descent ⇒ Object
- #get_encoding_name ⇒ Object
- #get_font_name ⇒ Object
- #get_unicode_width ⇒ Object
- #get_x_height ⇒ Object
Instance Method Details
#get_ascent ⇒ Object
1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 |
# File 'ext/hpdf.c', line 1797 static VALUE hpdf_font_get_ascent (VALUE obj) { HPDF_Font font; HPDF_INT i; Data_Get_Struct(obj, HPDF_Dict_Rec, font); HPDF_PTRACE(("hpdf_font_get_ascent font=%p\n", font)); i = HPDF_Font_GetAscent(font); return NUM2INT(i); } |
#get_bbox ⇒ Object
1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 |
# File 'ext/hpdf.c', line 1767 static VALUE hpdf_font_get_bbox (VALUE obj) { HPDF_Font font; HPDF_Rect rect; VALUE ret; VALUE left; VALUE bottom; VALUE right; VALUE top; Data_Get_Struct(obj, HPDF_Dict_Rec, font); HPDF_PTRACE(("hpdf_font_get_bbox font=%p\n", font)); rect = HPDF_Font_GetBBox(font); ret = rb_ary_new(); left = rb_float_new(rect.left); bottom = rb_float_new(rect.bottom); right = rb_float_new(rect.right); top = rb_float_new(rect.top); rb_ary_push(ret, left); rb_ary_push(ret, bottom); rb_ary_push(ret, right); rb_ary_push(ret, top); return ret; } |
#get_cap_height ⇒ Object
1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 |
# File 'ext/hpdf.c', line 1842 static VALUE hpdf_font_get_cap_height (VALUE obj) { HPDF_Font font; HPDF_UINT i; Data_Get_Struct(obj, HPDF_Dict_Rec, font); HPDF_PTRACE(("hpdf_font_get_cap_height font=%p\n", font)); i = HPDF_Font_GetCapHeight(font); return NUM2INT(i); } |
#get_descent ⇒ Object
1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 |
# File 'ext/hpdf.c', line 1812 static VALUE hpdf_font_get_descent (VALUE obj) { HPDF_Font font; HPDF_INT i; Data_Get_Struct(obj, HPDF_Dict_Rec, font); HPDF_PTRACE(("hpdf_font_get_descent font=%p\n", font)); i = HPDF_Font_GetDescent(font); return NUM2INT(i); } |
#get_encoding_name ⇒ Object
1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 |
# File 'ext/hpdf.c', line 1735 static VALUE hpdf_font_get_encoding_name (VALUE obj) { HPDF_Font font; const char* encoding_name; Data_Get_Struct(obj, HPDF_Dict_Rec, font); HPDF_PTRACE(("hpdf_font_get_encoding_name font=%p\n", font)); encoding_name = HPDF_Font_GetEncodingName(font); return rb_str_new2(encoding_name); } |
#get_font_name ⇒ Object
1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 |
# File 'ext/hpdf.c', line 1720 static VALUE hpdf_font_get_font_name (VALUE obj) { HPDF_Font font; const char* font_name; Data_Get_Struct(obj, HPDF_Dict_Rec, font); HPDF_PTRACE(("hpdf_font_get_font_name font=%p\n", font)); font_name = HPDF_Font_GetFontName(font); return rb_str_new2(font_name); } |
#get_unicode_width ⇒ Object
1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 |
# File 'ext/hpdf.c', line 1750 static VALUE hpdf_font_get_unicode_width (VALUE obj, VALUE code) { HPDF_Font font; HPDF_UINT i; HPDF_INT ret; Data_Get_Struct(obj, HPDF_Dict_Rec, font); i = NUM2INT(code); HPDF_PTRACE(("hpdf_font_get_unicode_width font=%p\n", font)); ret = HPDF_Font_GetUnicodeWidth(font, i); return INT2NUM(ret); } |
#get_x_height ⇒ Object
1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 |
# File 'ext/hpdf.c', line 1827 static VALUE hpdf_font_get_x_height (VALUE obj) { HPDF_Font font; HPDF_UINT i; Data_Get_Struct(obj, HPDF_Dict_Rec, font); HPDF_PTRACE(("hpdf_font_get_x_height font=%p\n", font)); i = HPDF_Font_GetXHeight(font); return NUM2INT(i); } |