Comments (10)
The Segoe family behaviour inside custom visuals is pretty weird. Segoe UI Bold and Segoe UI Semibold are not named font families available to the visual sandbox, so naming them as per the font property dropdowns doesn't work the same. You would need to apply the appropriate font-weight
to them within a custom visual. The following will work:
Segoe UI Bold
Measure =
VAR CSS = "
<style>
.test {
font-family: ""Segoe UI"", helvetica, arial, sans-serif;
font-weight: bold;
font-size: 40px;
color: #ADCDE9;
}
</style>"
RETURN
CSS&
"<span class='test'>My Test</span>"
Segoe UI Semibold
Measure =
VAR CSS = "
<style>
.test {
font-family: ""Segoe UI"", helvetica, arial, sans-serif;
font-weight: 600;
font-size: 40px;
color: #ADCDE9;
}
</style>"
RETURN
CSS&
"<span class='test'>My Test</span>"
DIN isn't passed to the visual sandbox as a valid font. In Deneb we have actually packaged the DIN font as a base64 asset that we can load and therefore access. TBH I'm surprised I haven't done this with HTML Content. I'm not currently planning any more releases, but I can try to find some time to do a minor release with these changes.
from powerbi-visuals-html-content.
Can I reopen this as a reminder to package DIN in the next release? This visual is useful for building KPIs and DIN is a standard font for that. Thanks
from powerbi-visuals-html-content.
I have to submit a bug fix release for iframes not working, so I'll add DIN to this build as well before I submit.
from powerbi-visuals-html-content.
1.4.1 has been submitted to AppSource. When this goes live, you will be able to specify either din
or wf_standard-font
as a font family to use DIN inside the visual.
html-content-issue-95-resolution.mp4
from powerbi-visuals-html-content.
Thanks Daniel. Just an FYI, that applying a font-weight of bold to Segoe UI does not render the same as Segoe (Bold). They're different fonts. Segoe (Bold) is a lot more elegant looking as you can see below. I also seem to get different results to you. 2 and 3 below look identical to me.
-
Standard text box Segoe (Bold) 32
-
.test {
font-family: ""Segoe UI"", helvetica, arial, sans-serif;
font-weight: bold;
font-size: 40px;
color: #ADCDE9;
} -
.test {
font-family: ""Segoe UI"", helvetica, arial, sans-serif;
font-weight: 600;
font-size: 40px;
color: #ADCDE9;
}
from powerbi-visuals-html-content.
In June 2019, MS standardised font size to points rather than pixels, which will be a contributing reason for why they look inconsistent here.
Here's a text box with Segoe (Bold) 32pt (top), and then HTML Content with the title styled the same (Segoe UI Bold, 32). The title is outside the sandbox, so should be the same as the text box. Underneath the title divider is the HTML Content body, with the measure as configured previously, but modified to 32pt
for font-size
.
For transparency, measure is as follows:
Measure =
VAR CSS = "
<style>
.test {
font-family: ""Segoe UI"", helvetica, arial, sans-serif;
font-weight: 700;
font-size: 32pt;
color: #000;
}
</style>"
RETURN
CSS&
"<span class='test'>My Test</span>"
This is HTML Content 1.4 (AppSource version) inside Power BI Desktop (Aug 2023)
As far as I can tell, these look the same across all three instances, although I wear glasses and am approaching middle age ;)
Unfortunately, MS doesn't provide Segoe UI Semibold in the text box as an option, so I can't repeat the test fully, but here's the title and body test repeated:
Modifying your workbook with the font size changes also looks right (to me):
...but have attached for your reference.
If you see differences between the text box and visual title, this is an MS issue. Anything that applies to the visual container is not available to visual developers and Power BI takes care of it.
If HTML Content's body looks different to its title, then we will need to have a look at potentially embedding those fonts, although MS doesn't permit them to be converted for embedding, so I'll have to progress this with them somehow.
from powerbi-visuals-html-content.
How bizarre - I still don't see what you see. I have tested on two completely different machines and I get consistent results on both.
The image above still has different fonts and I checked on two machines.
-
is the HTML 1.4 with a title and html content which should all look identical. The title is identical to the text box but the html still renders much chunkier
Measure2 =
VAR CSS = "
<style>
.test {
font-family: ""Segoe UI"", helvetica, arial, sans-serif;
font-weight: 700;
font-size: 32pt;
color: #ADCDE9;
}
</style>"
RETURN
CSS&
"<span class='test'>Here is a test</span>"
Opening your workbook with zero modifications shows me this:
The service shows me the same.
from powerbi-visuals-html-content.
To be super explicit:
This title is Segoe UI with a bold modifier and renders the same as the HTML content (quite chunky)
This title is Segoe UI Bold (no bold modifier) and renders much thinner than the HTML content
I think Segoe UI Bold is its font that may need to be packaged with DIN although I can't explain why you see something different with the exact same code.
from powerbi-visuals-html-content.
Here's how it looks like the Service for me:
I've tried this on 2 different machines (both on Win 11), 2 different versions of Power BI Desktop, 3 different tenants and both AppSource editions of HTML Content (regular and certified), just to be sure.
At this point, I'm genuinely stumped, so we may need more information to come through before I can progress any further.
from powerbi-visuals-html-content.
Thanks for checking. It is bizarre that we're seeing different things but I agree without more information then nothing can be done from your side. I'll close for now and reopen if anything else occurs to me.
from powerbi-visuals-html-content.
Related Issues (20)
- [ENHANCEMENT]
- Export to PPT/PDF is not supported. Please enhance the visual to support export functionality HOT 1
- [BUG] Unable to load the visual in Power bi desktop, getting error "The content is blocked. Contact the site owner to fix the issue."
- [Accessibility] Allow scrolling with arrow key for keyboard users, support keyboard focus HOT 8
- I want to customize this visual for a specific use case. HOT 1
- [BUG] Sharepoint imagesURL stopped showing in PBI server HOT 3
- FAQ Update
- Iframe reload on click HOT 2
- [ENHANCEMENT] HOT 2
- [EMBED] Website no opening on Power BI HOT 1
- [BUG] Can't delete the visual from the repot canvas HOT 1
- [BUG] Text limit for HTML Text HOT 4
- [BUG] class attribute does not pass sanitization in certified visual
- Support for pyodide [ENHANCEMENT] HOT 1
- Functionality <form> with Method Post HOT 2
- 'Export to PDF' currently not supported HOT 2
- iframe external webpages not loading from Aug 29, 2023 in Power BI. HOT 8
- [BUG] Visual not redering on reload HOT 3
- [BUG] The link is malformed: #Top HOT 2
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 powerbi-visuals-html-content.