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

Labeling: Creator and Player should use matching fonts on the labels #5

Open
zachberry opened this issue Aug 13, 2015 · 5 comments
Open

Comments

@zachberry
Copy link
Member

They're different currently which is unexpected

@WilliamRADFunk WilliamRADFunk self-assigned this Sep 22, 2015
@SMason2057 SMason2057 self-assigned this Dec 21, 2015
@SMason2057 SMason2057 removed their assignment Jan 19, 2016
@zachberry
Copy link
Member Author

QAing

@zachberry zachberry self-assigned this Feb 10, 2016
@zachberry
Copy link
Member Author

https://clu.cdl.ucf.edu/materia/labeling/commits/issue/579-matching-label-fonts

Fonts now match, however font sizes don't. My goal is to make those labels 100% identical. Looked into it - if you search the project for fontSize you'll find nearly identical code that modifies the fontSize as you type. These should be turned into a reusable method so that the code can be the same and use the same values.

The code should use the 15 magic value instead of the 16 magic value as 15 is what is used in the player and that is what was using Roboto Slab originally.

@zachberry
Copy link
Member Author

/Users/zberry/Sites/nm/kogneato/devmateria/sandbox/labeling/creator.coffee:
  383   _termKeyUp = (e) ->
  384       e = window.event if not e?
  385:      fontSize = (16 - e.target.innerHTML.length / 10)
  386:      fontSize = 12 if fontSize < 12
  387:      e.target.style.fontSize = fontSize + 'px'
  388  
  389   # When typing on a term, resize the font accordingly

/Users/zberry/Sites/nm/kogneato/devmateria/sandbox/labeling/player.coffee:
  131           term.addEventListener('MSPointerDown', _mouseDownEvent, false)
  132  
  133:          fontSize = (15 - question.questions[0].text.length / 10)
  134:          fontSize = 12 if fontSize < 12
  135:          term.style.fontSize = fontSize + 'px'
  136  
  137           # Some legacy qsets store these as strings, which we certainly don't want

10 matches across 2 files

@zachberry zachberry removed their assignment Feb 10, 2016
@samuel-belcastro samuel-belcastro self-assigned this Sep 22, 2016
@samuel-belcastro
Copy link

Made a private method in the player and creator that sets font size the same way as one another. Also merged in the current labeling master branch.

To QA:

  1. Switch to branch issue/579-matching-label-fonts in the labeling repo
  2. Go to devmateria, and interact with the widget as creator and player.
    • Make sure the widget works exactly the same, and inspect the labels to make sure the font sizes are almost identical
  3. Install to Materia
  4. Repeat steps 1 and 2

@samuel-belcastro samuel-belcastro removed their assignment Sep 22, 2016
@WilliamRADFunk
Copy link
Contributor

WilliamRADFunk commented Dec 16, 2016

Merged master in to incorporate the super-build mega changes.

Followed Sam's testing steps. Fonts on both creator and player look the same in both Devmateria and Materia.

LGTM

@iturgeon iturgeon transferred this issue from ucfopen/Materia Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants