-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfont_source.go
More file actions
20 lines (16 loc) · 810 Bytes
/
Copy pathfont_source.go
File metadata and controls
20 lines (16 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright 2012 Brent Rowland.
// Use of this source code is governed the Apache License, Version 2.0, as described in the LICENSE file.
package font
type FontSource interface {
Select(family, weight, style string, ranges []string) (font FontMetrics, err error)
SubType() string
}
// ClosestFontSource is an optional extension consulted only when the caller
// explicitly requests nearest-face matching. Implementations must stay within
// family, preserve range restrictions, and return a real face rather than
// synthesizing bold or italic. FontSource remains unchanged so AFM and custom
// sources need not implement approximate matching.
type ClosestFontSource interface {
SelectClosest(family, weight, style string, ranges []string) (font FontMetrics, err error)
}
type FontSources []FontSource