display emojis in submission comment pdfs

closes EVAL-2943
flag=none

Test Plan:
1. Create a course with an emoji in the name and publish it
2. Create an assignment with an emoji in the name and publish it
3. Add a student to the course
4. Submit to the assignment as the student
5. Enter a comment with an emoji
6. Download the submission comments from the Speedgrader
7. Observe that emojis are displayed properly in the report

Change-Id: I1c7ca39e7d10e9b65991c01be86e24c62dc58cd9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315403
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Derek Williams <derek.williams@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Sam Garza <sam.garza@instructure.com>
Build-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
This commit is contained in:
Spencer Olson 2023-04-06 16:57:09 -05:00
parent 0b1b17cc65
commit 6df8dcacb2
3 changed files with 10 additions and 0 deletions

View File

@ -108,6 +108,7 @@ gem "oj", "3.10.16"
gem "outrigger", "3.0.1"
gem "pdf-reader", "2.5.0"
gem "pg_query", "2.2.0"
gem "prawn-emoji", "~> 5.3", require: false
gem "prawn-rails", "1.3.0"
gem "matrix", "0.4.2" # Used to be a default gem but is no more, but prawn depends on it implicitly
gem "prosopite", "~> 1.3"

View File

@ -839,6 +839,9 @@ GEM
prawn (2.4.0)
pdf-core (~> 0.9.0)
ttfunk (~> 1.7)
prawn-emoji (5.3.0)
prawn (~> 2.3)
unicode-emoji (~> 3.1)
prawn-rails (1.3.0)
prawn
prawn-table
@ -1110,6 +1113,9 @@ GEM
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.1.0)
unicode-emoji (3.3.1)
unicode-version (~> 1.0)
unicode-version (1.3.0)
uri_template (0.7.0)
vault (0.15.0)
aws-sigv4
@ -1318,6 +1324,7 @@ DEPENDENCIES
pdf-reader (= 2.5.0)
pg (= 1.4.5)
pg_query (= 2.2.0)
prawn-emoji (~> 5.3)
prawn-rails (= 1.3.0)
prosopite (~> 1.3)
pry-byebug (= 3.10.1)

View File

@ -1,6 +1,8 @@
# i18nliner/i18n_extractor currently do not support prawn templates
# so pass I18nable strins from the controller until this is resovled
require 'prawn/emoji'
prawn_document(page_layout: :portrait, page_size: page_size) do |pdf|
pdf.font_families.update('LatoWeb' => {
normal: "public/fonts/lato/latin/LatoLatin-Regular.ttf",