-
Notifications
You must be signed in to change notification settings - Fork 545
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
Support custom fonts in Host Config on Android #271
Comments
Closing as inactive and no customer requests |
As a user of Adaptive Cards, this feature is crucial to me. Fonts are an essential part of consistent branding and styling. The behavior here is currently inconsistent between platforms. On iOS, custom fonts are registered by the app and from there, they are loaded the same way as system fonts. So the iOS renderer does in fact support custom fonts by default. On Android, however, a font assets that is bundled in the .apk must be loaded via Please consider the following change to
Would the Adaptive Card maintainers consider adding something like this to the SDK? Thanks for your time. |
Thanks @patgoley, that seems like an excellent addition, @shalinijoshi19 and @almedina-ms can we look at adding this to Android? Seems like an easy fix :) @patgoley, when would you need this support by to avoid forking? Also just out of curiosity, do you mind sharing how you're using adaptive cards? Sounds like you're rendering them in your own apps? :) |
Wow, thanks for the positive feedback! Honestly, I've already forked and made these changes. I'm happy to submit a PR (it's basically what I've pasted above, haven't updated the test suite). I would've already shipped it by now, but I'm having trouble building the forked repo using Jitpack (https://stackoverflow.com/questions/56859420/fork-a-monorepo-and-build-a-subdirectory-using-jitpack/56859614#56859614). Separate issue, I think the answer there may be a good temporary solution. The company I work for is building a chat bot centered application. We have developed quite a few custom card types ourselves, but each one has a static layout and other limitations. We're integrating Adaptive Cards to hopefully use as our singular card type which should be flexible enough to handle all of our use cases. It's been working great so far, this font issue is the last hold up on shipping this feature! |
I think a PR would be awesome, but I'll leave that decision up to @shalinijoshi19 and @almedina-ms (our dev lead and Android dev) for the final call :) We also might be able to help with the jitpack issues, I don't know how much Alberto knows about jitpack, but maybe there's something we can do if you don't get anything working! That's so cool to hear about your company's chat bot app! One off-topic question while I have you - what have you done for supporting actions? Did you use Action.Submit and you're handling actions with inputs through that? We've been looking into how we can unify actions so that an author can write a single action that works everywhere. The most likely candidate is an Action.Http which the author specifies a URL callback and when clicked, the card does a HTTP POST, including the input values, to the URL, and then the author's server can respond back with new content. Would that universal action model be helpful to you? Or no need for your scenarios? |
Thanks for the feedback! I've opened a PR with my changes so you can have a look and make a decision about how to proceed, if at all. Regarding jitpack, if you can provide any assistance that'd be amazing. If not, I think I can work around it by building my fork into a .jar and including that in my host application. I'd posted the wrong link to my SO question, I've edited my previous comment with the right link. It's here: https://stackoverflow.com/questions/56859420/fork-a-monorepo-and-build-a-subdirectory-using-jitpack/56859614#56859614 Regarding actions, Submit and OpenUrl are enough to cover our use cases. For OpenUrl, we just open the content in a web browser. For Submit, we pass the button title as a message to our bot and the bot engine does whatever it needs to from there. I could see how an HTTP post might be useful to other applications, but I wonder about endpoints that required an auth header or similar that I'd need to inject into your POST request. |
Awesome, one last question, are you using Bot Framework or is the "bot engine" your own bot engine you've built? |
It is our own bot engine. |
@almedina-ms can you work with @patgoley to get this looked at? Thanks! |
This fix was merged by @patgoley and a sample was recently merged |
If an app has a custom font packaged within their app, the Renderers needs a way to load that custom font from the host config.
iOS already supports custom fonts, but Android doesn't and would need a new API for hosts to register their custom font.
The text was updated successfully, but these errors were encountered: