diff options
Diffstat (limited to 'chrome/common/gfx/chrome_font.cc')
-rw-r--r-- | chrome/common/gfx/chrome_font.cc | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/chrome/common/gfx/chrome_font.cc b/chrome/common/gfx/chrome_font.cc index 198227e..670eeb2 100644 --- a/chrome/common/gfx/chrome_font.cc +++ b/chrome/common/gfx/chrome_font.cc @@ -26,11 +26,14 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include "chrome/common/gfx/chrome_font.h" -#include <algorithm> +#include <windows.h> #include <math.h> +#include <algorithm> + #include "base/logging.h" #include "base/win_util.h" #include "chrome/app/locales/locale_settings.h" @@ -105,6 +108,26 @@ int ChromeFont::FontSize() { return font_size; } +ChromeFont::HFontRef::HFontRef(HFONT hfont, + int height, + int baseline, + int ave_char_width, + int style, + int dlu_base_x) + : hfont_(hfont), + height_(height), + baseline_(baseline), + ave_char_width_(ave_char_width), + style_(style), + dlu_base_x_(dlu_base_x) { + DLOG_ASSERT(hfont); +} + +ChromeFont::HFontRef::~HFontRef() { + DeleteObject(hfont_); +} + + ChromeFont ChromeFont::DeriveFont(int size_delta, int style) const { LOGFONT font_info; GetObject(hfont(), sizeof(LOGFONT), &font_info); |