Module: Fontina::Windows::MetaPackage
- Defined in:
- lib/fontina/windows/meta_package.rb
Constant Summary
Constants included
from Marshal
Fontina::Windows::Marshal::BYTE, Fontina::Windows::Marshal::WCHAR
Instance Method Summary
collapse
Instance Method Details
#install(force: false) ⇒ Object
#installed? ⇒ Boolean
22
23
24
25
26
27
|
# File 'lib/fontina/windows/meta_package.rb', line 22
def installed?
!!(path = Windows.font_registered? registered_name) and
path = File.expand_path(path, Windows.fonts_directory) and
File.file?(path) and
File.open(path) { |io| FileUtils.compare_stream io.binmode, StringIO.new(file.content) }
end
|
#registered_name ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/fontina/windows/meta_package.rb', line 10
def registered_name
@registered_name ||= begin
name = package.preferred_name \
? wstr(package.preferred_name.name)
: package.fonts.map { |f| wstr(f.preferred_name.name) }.join(wstr(' & '))
[Formats::OpenType].include?(format) \
? name + wstr(' (TrueType)')
: name
end
end
|