Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black text not visible #5291 #5409

Merged
merged 1 commit into from
Oct 25, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/display/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

// Minimal font size that would be used during canvas fillText operations.
var MIN_FONT_SIZE = 16;
// Maximum font size that would be used during canvas fillText operations.
var MAX_FONT_SIZE = 100;
var MAX_GROUP_SIZE = 4096;

var COMPILE_TYPE3_GLYPHS = true;
Expand Down Expand Up @@ -1226,9 +1228,9 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
// Keeping the font at minimal size and using the fontSizeScale to change
// the current transformation matrix before the fillText/strokeText.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=726227
var browserFontSize = size >= MIN_FONT_SIZE ? size : MIN_FONT_SIZE;
this.current.fontSizeScale = browserFontSize !== MIN_FONT_SIZE ? 1.0 :
size / MIN_FONT_SIZE;
var browserFontSize = size < MIN_FONT_SIZE ? MIN_FONT_SIZE :
size > MAX_FONT_SIZE ? MAX_FONT_SIZE : size;
this.current.fontSizeScale = size / browserFontSize;

var rule = italic + ' ' + bold + ' ' + browserFontSize + 'px ' + typeface;
this.ctx.font = rule;
Expand Down