#include "config.h"
#include "Font.h"
#include "FontData.h"
#include "FontFallbackList.h"
#include "GraphicsContext.h"
#include "IntRect.h"
#include "GlyphBuffer.h"
#include "fontprops.h"
#include <wx/defs.h>
#include <wx/dcclient.h>
#include "NotImplemented.h"
namespace WebCore {
void Font::drawGlyphs(GraphicsContext* graphicsContext, const FontData* font, const GlyphBuffer& glyphBuffer,
int from, int numGlyphs, const FloatPoint& point) const
{
Color color = graphicsContext->fillColor();
#if USE(WXGC)
wxGraphicsContext* dc = (wxGraphicsContext*)graphicsContext->platformContext();
dc->SetFont(*font->getWxFont(), color);
#else
wxDC* dc = graphicsContext->platformContext();
dc->SetTextBackground(color);
dc->SetTextForeground(color);
dc->SetFont(*font->getWxFont());
#endif
GlyphBufferGlyph* glyphs = const_cast<GlyphBufferGlyph*>(glyphBuffer.glyphs(from));
int offset = point.x();
wxString text = wxEmptyString;
for (unsigned i = 0; i < numGlyphs; i++) {
text = text.Append((wxChar)glyphs[i]);
offset += glyphBuffer.advanceAt(from + i);
}
float height = font->ascent() - font->descent();
wxCoord ypoint = (wxCoord) (point.y() - height);
dc->DrawText(text, (wxCoord)point.x(), ypoint);
}
FloatRect Font::selectionRectForComplexText(const TextRun& run, const TextStyle& style, const IntPoint& point, int h, int from, int to) const
{
notImplemented();
return FloatRect();
}
void Font::drawComplexText(GraphicsContext* graphicsContext, const TextRun& run, const TextStyle& style, const FloatPoint& point, int from, int to) const
{
notImplemented();
}
float Font::floatWidthForComplexText(const TextRun& run, const TextStyle& style) const
{
notImplemented();
return 0;
}
int Font::offsetForPositionForComplexText(const TextRun& run, const TextStyle& style, int x, bool includePartialGlyphs) const
{
notImplemented();
return 0;
}
}