-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Font family ignored in title (or html) properties for swalOptions #19
Comments
Can you first try those options with sweetalert 2 (without electron-alert) and see if it works. |
I'll then try and incorporate a workaround for electron-alert |
https://stackoverflow.com/questions/8749225/loading-an-external-font-via-inline-css Bear in mind you can inject things into the |
@pjebs Thanks for the options! I tried out using the same behaviour with sweetalert2 and it did work. It does seem like the link for the font is not loading correctly, but we did try it out with the external font via inline css and that did not work either. There is one other thing though. We also tried adding failovers to the font-family like this:
which would technically set it up to Arial or sans-serif as last resort, but it always set up the font with Times New Roman. We also tried directly setting up the last resort option, sans-serif
and this way it did work!! We can work with this at the moment, but im not sure why the fall back did not work. |
Maybe that font is not available in the Browser Window. In your other browserwindow's, does the font work? |
Yes it does! |
title: '<span style="font-size: 1.15rem; font-weight: bold; font-family: font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif; ">Title of Toast', Is there a reason why you have font Family written twice? |
Sorry! That was a copy error, when testing the font-family attribute is not added twice |
That's strange because electron alert is just a plain browserwindow with sweetslert2 being displayed in the inside. |
Exactly, but then again, currently we can work with sans-serif. Although, would be nice to have set up a property in the options for the font. |
Did you try injecting style info into head via the Alert constructor. Also, in the constructor, you can enable devtools. Can you enable it and try and manipulate the Dom directly to change the font to see if it recognises the font. |
|
I will try that, but first have you had any issues with the usage in Windows? |
No. What are your windows issues. I use it on Mac and windows. I've never changed the font though. |
Not sure why, but sometimes the toast message does not appear. We have been testing it on Mac and everything is working correctly. Now with Windows, the toast has only appeared once. Not sure if its an issue of multiple monitors, but the monitors are mirroring the main display, so it should appear. |
It uses this package: https://github.com/jenslind/electron-positioner Can you try with another browserwindow using this package if it works on windows? |
The window is completely fullscreen. We also tried positioning it in the center, but the message does not appear. |
I don't have access to windows at the moment. I mean a brand new (non full screen) BrowserWindow. |
If the window is full screen, the notification is underneath and being covered. You need to set alwaysOnTop to true. |
We tried out different event emitters. We ended up using the handle/invoke combo (event though the alert does not return anything) which did work. We were previously using send/once to show it. This works for Mac but not on Windows. |
Should I rewrite electron alert with handle/invoke? |
? |
We are setting up the title to include inline styling. Both the font-size and font-weight and are applied but not the font-family.
The text was updated successfully, but these errors were encountered: