Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1008)

Issue 2171045: code review 2171045: freetype: add a clip rectangle. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 8 months ago by nigeltao
Modified:
13 years, 8 months ago
Reviewers:
nigeltao_gnome, rog
CC:
r, golang-dev
Visibility:
Public.

Description

freetype: add a clip rectangle.

Patch Set 1 #

Patch Set 2 : code review 2171045: freetype: add a clip rectangle. #

Patch Set 3 : code review 2171045: freetype: add a clip rectangle. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -1 line) Patch
M example/freetype/main.go View 1 chunk +1 line, -0 lines 0 comments Download
M freetype/freetype.go View 3 chunks +13 lines, -1 line 0 comments Download

Messages

Total messages: 7
nigeltao
Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change.
13 years, 8 months ago (2010-09-13 08:15:18 UTC) #1
r
LGTM
13 years, 8 months ago (2010-09-13 08:16:47 UTC) #2
nigeltao
*** Submitted as http://code.google.com/p/freetype-go/source/detail?r=ed4497e120af *** freetype: add a clip rectangle. R=r CC=golang-dev http://codereview.appspot.com/2171045
13 years, 8 months ago (2010-09-13 08:21:12 UTC) #3
rog
i'm a bit concerned by the way that freetype.Context is going. AFAICS, it is significantly ...
13 years, 8 months ago (2010-09-13 11:26:50 UTC) #4
nigeltao_gnome
On 13 September 2010 21:26, roger peppe <rogpeppe@gmail.com> wrote: > i removed the error return ...
13 years, 8 months ago (2010-09-14 00:59:13 UTC) #5
r
i agree with the proposal to keep the point as an explicit argument and return ...
13 years, 8 months ago (2010-09-14 03:26:50 UTC) #6
rog
13 years, 8 months ago (2010-09-14 08:29:39 UTC) #7
On 14 September 2010 01:59, Nigel Tao <nigel.tao.gnome@gmail.com> wrote:
> On 13 September 2010 21:26, roger peppe <rogpeppe@gmail.com> wrote:
>> i removed the error return because passing a nil Font is really no different
>> to passing a nil anything else - and we don't check that everything is
non-nil
>> at every opportunity; a panic is fine IMHO. that is: the caller of DrawText
>> can easily check for the error (font != nil) without checking the return
>> from DrawText every time.
>
> The error isn't necessarily a nil font; it could be a malformed font.

yes, i'd missed that. i still think that the error return is somewhat
unnecessary. as a caller of DrawText, there's very little i can do
about a malformed font - it's not a show stopper, and i'd like as
much valid text to be displayed as possible.

> I also can't remember whether a missing glyph is an error or silently
> falls back to a default glyph.

i'd prefer the latter option (possibly with a way to log errors when
they happen, to enable debugging of buggy fonts)

the alternative, as i see it, is that every client that draws text
will either display nothing, or quit with an error, when a dodgy
font is encountered - neither behaviour being particularly desirable.

> I'm still thinking about your Painter suggestion. It was removed
> mostly because of glyph caching, but also partly because people found
> the number of moving parts confusing. My current thinking is that the
> freetype/raster and freetype/truetype packages should provide the
> lower-level APIs to let you do whatever you want, and the freetype
> top-level package provides a convenience API that makes common tasks
> easy without necessarily giving you the kitchen sink. Doing something
> with a custom Painter might require using the lower-level APIs.

the problem with this is that freetype.go contains quite a bit of complex
functionality. to use the lower level APIs all that would need to be
duplicated or rewritten, which doesn't seem right to me.

personally, i found the Painter interface quite intuitive,
although i certainly agree that use of it should be optional.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b