maelvls / homebrew-amc

🍺 Homebrew formula for auto-multiple-choice 📖
https://www.auto-multiple-choice.net/download-macosx.en
34 stars 10 forks source link

Annotations don't display properly #33

Closed chuffman377 closed 4 years ago

chuffman377 commented 5 years ago

TL;DR: Pango 1.44.4 introduces a regression; with Pango 1.42.4, annotations work:

brew unlink pango
brew install --build-from-source https://raw.githubusercontent.com/Homebrew/homebrew-core/a8ac7ea5/Formula/pango.rb
brew switch pango 1.42.4_2
brew pin pango # skip upgrades from 'brew upgrade'

I've used AMC in the past and have just reinstalled the program using homebrew. I've encountered a new problem I've not seen before. When I "Annotate Papers," I can see that the annotations are correct, but they are not displayed properly. They are squished so that each letter or number is almost on top of one another. Below is a screenshot.

image

I'm not sure what you'd like to see to help solve my problem. Here is some text from the terminal in which AMC was launched:

2019-08-23 10:34:19.045 perl[1923:14056] IMKInputSession presentFunctionRowItemTextInputViewWithEndpoint:completionHandler: : [self textInputContext]=0x7f8283e04950 *NO* NSRemoteViewController to client, NSError=Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 0 was invalidated from this process." UserInfo={NSDebugDescription=The connection from pid 0 was invalidated from this process.}, com.apple.inputmethod.EmojiFunctionRowItem
WARNING: You don't seem to have a mime-info database. The
shared-mime-info package is available from http://freedesktop.org/ .

Also, I'm getting this error in the Marking tab, which may be unrelated:

image
mpereda commented 5 years ago

Hi! thanks. I've installed it with "brew install auto-multiple-choice" and it installs ok and opens ok.

But sadly, the annotation problem is still there:

Screen Shot 2019-11-17 at 20 08 01
maelvls commented 5 years ago

😩 Could someone share an example of project (with everything needed) so that I can test locally? 🙂

mpereda commented 5 years ago

Here you have. It's just the example on the amc web with an answers sheet. I cannot share real exams used in class.

https://wetransfer.com/downloads/fc95e165c37ac48b3c2fa342c7d2743420191119073729/3b142c5c2bd0bdc23788adc63239fea320191119073729/9c2870

maelvls commented 5 years ago

Thanks! This time, I think the latest 1.4.0_6 works! I tested with the above 'toyP' project, and the annotations appeared (I had to reset my ~/.AMC.d/cf.default.xml settings though)

Screenshot 2019-11-22 at 12 30 36

The two things that I had to make sure were

To which pango lib the Pango.bundle and AMC-buildpdf are linking against?

$ otool -L /usr/local/Cellar/auto-multiple-choice/1.4.0_6/libexec/lib/perl5/darwin-thread-multi-2level/auto/Pango/Pango.bundle
/usr/local/Cellar/auto-multiple-choice/1.4.0_6/libexec/lib/perl5/darwin-thread-multi-2level/auto/Pango/Pango.bundle:
    /usr/local/opt/amc-pango/lib/libpango-1.0.0.dylib (compatibility version 4201.0.0, current version 4201.4.0)
    /usr/local/opt/amc-pango/lib/libpangocairo-1.0.0.dylib (compatibility version 4201.0.0, current version 4201.4.0)

$ otool -L /usr/local/Cellar/auto-multiple-choice/1.4.0_6/lib/AMC/exec/AMC-buildpdf
/usr/local/Cellar/auto-multiple-choice/1.4.0_6/lib/AMC/exec/AMC-buildpdf:
    /usr/local/opt/amc-pango/lib/libpangocairo-1.0.0.dylib (compatibility version 4201.0.0, current version 4201.4.0)
    /usr/local/opt/amc-pango/lib/libpango-1.0.0.dylib (compatibility version 4201.0.0, current version 4201.4.0)
technofeliz commented 5 years ago

Tested, and validated.

A brew update and brew upgrade didn't work at first.

So, I switch pango to the new version (to remove the annotation workaround) : brew switch pango 1.44.7

Then I re-install all AMC dependencies (#BruteForceReInstall)... brew reinstall $(brew deps auto-multiple-choice)

It looks It's working fine (annotations creation included). I will test on a new project from scratch next week.

Thanks for this new version !

mpereda commented 5 years ago

It's working !!! For me, I have just needed to brew update, brew upgrade, and install amc.

Thank you very much!!!!

maelvls commented 4 years ago

Closing since the issue disappeared when I pinned the pango version to 1.42.4 in the formula.

The issue with pango 1.44 is here: https://gitlab.gnome.org/GNOME/librsvg/issues/520