Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: Source/WebKit/chromium/public/WebFont.h

Issue 16358003: mv Source/WebKit/chromium/public to public/webview (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebKit/chromium/public/WebFindOptions.h ('k') | Source/WebKit/chromium/public/WebFontCache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/public/WebFont.h
diff --git a/Source/WebKit/chromium/public/WebFont.h b/Source/WebKit/chromium/public/WebFont.h
index f9dee810e5bb58baba8081b128de4fe9be6a4297..606ab1c05b553b08d371c330e2005bac378b0165 100644
--- a/Source/WebKit/chromium/public/WebFont.h
+++ b/Source/WebKit/chromium/public/WebFont.h
@@ -1,100 +1 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * 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.
- */
-
-#ifndef WebFont_h
-#define WebFont_h
-
-#include "../../../../public/platform/WebCanvas.h"
-#include "../../../../public/platform/WebColor.h"
-#include "../../../../public/platform/WebCommon.h"
-
-namespace WebKit {
-
-struct WebFontDescription;
-struct WebFloatPoint;
-struct WebFloatRect;
-struct WebPoint;
-struct WebRect;
-struct WebTextRun;
-
-class WebFont {
-public:
- virtual ~WebFont() { }
-
- WEBKIT_EXPORT static WebFont* create(const WebFontDescription&);
-
- virtual WebFontDescription fontDescription() const = 0;
-
- virtual int ascent() const = 0;
- virtual int descent() const = 0;
- virtual int height() const = 0;
- virtual int lineSpacing() const = 0;
- virtual float xHeight() const = 0;
-
- // Draws the text run to the given canvas. The text is positioned at the
- // given left-hand point at the baseline.
- //
- // The text will be clipped to the given clip rect. |canvasIsOpaque| is
- // used to control whether subpixel antialiasing is possible. If there is a
- // possibility the area drawn could be semi-transparent, subpixel
- // antialiasing will be disabled.
- //
- // |from| and |to| allow the caller to specify a subrange of the given text
- // run to draw. If |to| is -1, the entire run will be drawn.
- virtual void drawText(WebCanvas*, const WebTextRun&, const WebFloatPoint& leftBaseline, WebColor,
- const WebRect& clip, bool canvasIsOpaque,
- int from = 0, int to = -1) const = 0;
-
- // Measures the width in pixels of the given text run.
- virtual int calculateWidth(const WebTextRun&) const = 0;
-
- // Returns the character offset corresponding to the given horizontal pixel
- // position as measured from from the left of the run.
- virtual int offsetForPosition(const WebTextRun&, float position) const = 0;
-
- // Returns the rectangle representing the selection rect for the subrange
- // |from| -> |to| of the given text run. You can use -1 for |to| to specify
- // the entire run (this will do something similar to calling width()).
- //
- // The rect will be positioned as if the text was drawn at the given
- // |leftBaseline| position. |height| indicates the height of the selection
- // rect you want, typically this will just be the height() of this font.
- //
- // To get the pixel offset of some character (the opposite of
- // offsetForPosition()), pass in a |leftBaseline| = (0, 0), |from| = 0, and
- // |to| = the character you want. The right edge of the resulting selection
- // rect will tell you the right side of the character.
- virtual WebFloatRect selectionRectForText(const WebTextRun&, const WebFloatPoint& leftBaseline,
- int height, int from = 0, int to = -1) const = 0;
-};
-
-} // namespace WebKit
-
-#endif
+#include "../../../../public/webview/WebFont.h"
« no previous file with comments | « Source/WebKit/chromium/public/WebFindOptions.h ('k') | Source/WebKit/chromium/public/WebFontCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698