Omit fonts.css on QtWebKit clients

QTBUG-3467 prevents non-normal-face @font-face fonts from being used when
defined as such in CSS. To work around this, the desktop applications now
ship the Humbug font themselves, and this commit causes the server to no
longer send the problematic CSS rules to those clients.

We have some duplication insofar as we now have two minified CSS files, but
this is better than conditionally applying the CSS at page runtime.

(imported from commit 9a887f9fb8002d44171d366d1249ebbf21cc9c77)
This commit is contained in:
Luke Faraone
2013-07-01 14:13:26 -04:00
parent 0f839522a7
commit cf81c46c77
5 changed files with 364 additions and 336 deletions

View File

@@ -579,12 +579,22 @@ def home(request):
{'user_profile': user_profile,
'page_params' : page_params,
'avatar_url': avatar_url(user_profile),
'nofontface': is_buggy_ua(request.META["HTTP_USER_AGENT"]),
'show_debug':
settings.DEBUG and ('show_debug' in request.GET),
'show_invites': show_invites
},
context_instance=RequestContext(request))
def is_buggy_ua(agent):
"""Discrimiate CSS served to clients based on User Agent
Due to QTBUG-3467, @font-face is not supported in QtWebKit.
This may get fixed in the future, but for right now we can
just serve the more conservative CSS to all our desktop apps.
"""
return "Humbug Desktop/" in agent
def get_pointer_backend(request, user_profile):
return json_success({'pointer': user_profile.pointer})