Comments (7)
My test case was using something along the lines of tts:fontFamily="myCustomFont, Arial, Helvetica, default"
. So default
was used as a fallback rather than a single entry.
With the above in mind, I think there might be a problem similar to #245
default
doesn't get converted to monospaceSerif
correctly with the space character at the start when the array is split. It could be solved using trim()
again?
from imscjs.
Hi @palemieux yes I do. The reason is that it is where we have it in the BBC fork, and the reason we put it there is because we apply styling options when HTML mapping, so that they happen whenever we render an ISD, not just on document parsing. The specific example here is at https://github.com/bbc/imscJS/blob/4b194d20e590f255e4168f9d3ddfd28430b35590/src/main/js/html.js#L1470-L1472
if (context.options.fontFamily) {
attr = context.options.fontFamily.split(",");
}
Then we process the split attr
. That way if the customisation options change then we only have to generate new HTML for the current ISD, and the syntax of the fontFamily
option is the same as the syntax in the TTML document, which can include spaces.
from imscjs.
@mattjuggins It sounds like adding a trim()
at time of parsing should work.
from imscjs.
When specified, tts:fontFamily="default"
is parsed as "monospaceSerif"
per
Line 191 in bf2e98a
The initial value of tts:fontFamily
is also aliased to "monospaceSerif"
since initial values, as specified in TTML, are subjected to the same parsing.
Do you have a test case that demonstrates the issue you are encoutering?
from imscjs.
@nigelmegitt Do you recall why trim()
at #246 was applied during HTML mapping instead of TTML parsing?
instead of:
Line 197 in bf2e98a
from imscjs.
I agree, that should work.
from imscjs.
Excellent. Thanks both. I've opened up #251 for this.
from imscjs.
Related Issues (20)
- For .. in loops not protected from iterating prototype properties HOT 14
- Upgrade to use es6 language features? HOT 1
- `Set()` has a name clash with the ES6 `Set` object HOT 1
- Multiple referenced generic font family names can result in duplicate font-family values
- Error parsing fontSize with two lengths HOT 2
- Improve performance with a large number of regions and ISDs
- Unable to specify rgba color values for tts:textShadow HOT 1
- elementBoundingRect needs to be declared a `var`
- Update timeBase attribute to accept full list of values HOT 6
- adjacent tts:textCombine spans are combined into a single span HOT 3
- HTML rb, rtc and rbc elements are deprecated HOT 2
- if a line starts/ends with a ruby definition, line padding is not applied
- SMPTE timecode parsed incorrectly (23.976 FPS) HOT 1
- Resolve images source while generating ISD HOT 18
- Replace the XML SAX parser with a DOM parser HOT 10
- Spaces in `tts:fontFamily` list not handled in HTMLStylingMapDefinition code HOT 1
- Firefox bug with negative margins HOT 1
- fillLineGap doesn't always fill the gap HOT 12
- Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'imscISD') HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imscjs.