Render and embed OpenType CFF fonts selected by pdfTeX maps
This commit is contained in:
1 parent
46ef76f890
commit
fd5ab59f42
11 files changed
+433
-57
No files matched your search
@@ -157,8 +157,7 @@ impl NativeText {
|
||||
let expansion = if self.xdv { font.expansion } else { self.expansion };
|
||||
let advance = match &paint.program {
|
||||
crate::native_font::NativeFontProgram::Pk(pk) => pk.advances[&slot],
|
||||
crate::native_font::NativeFontProgram::Type1(_)
|
||||
| crate::native_font::NativeFontProgram::TrueType(_) => {
|
||||
_ => {
|
||||
let factor = i64::from(1000 + expansion);
|
||||
let width = if !self.xdv || font.layout_metrics.is_some() {
|
||||
Self::round_scale(font.advance(slot), 1000, factor)
|
||||
@@ -266,11 +265,7 @@ pub(crate) struct FontHistory {
|
||||
impl FontHistory {
|
||||
fn record(&mut self, font: &NativeFont, paint: &crate::native_font::NativeFontPaint) {
|
||||
if self.used.insert(font.id)
|
||||
&& matches!(
|
||||
paint.program,
|
||||
crate::native_font::NativeFontProgram::Type1(_)
|
||||
| crate::native_font::NativeFontProgram::TrueType(_)
|
||||
)
|
||||
&& !matches!(paint.program, crate::native_font::NativeFontProgram::Pk(_))
|
||||
&& !self.first_scalable.contains_key(&font.name)
|
||||
{
|
||||
self.first_scalable.insert(font.name.clone(), font.id);
|
||||
|
||||
Reference in new issue
Block a user