Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: Source/core/css/resolver/FontBuilder.cpp

Issue 444413003: Make style building for font-weight less custom. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2013 Google Inc. All rights reserved. 4 * Copyright (C) 2013 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 scope.fontDescription().setSpecifiedSize(size); 353 scope.fontDescription().setSpecifiedSize(size);
354 } 354 }
355 355
356 void FontBuilder::setWeight(FontWeight fontWeight) 356 void FontBuilder::setWeight(FontWeight fontWeight)
357 { 357 {
358 FontDescriptionChangeScope scope(this); 358 FontDescriptionChangeScope scope(this);
359 359
360 scope.fontDescription().setWeight(fontWeight); 360 scope.fontDescription().setWeight(fontWeight);
361 } 361 }
362 362
363 void FontBuilder::setWeightBolder()
364 {
365 FontDescriptionChangeScope scope(this);
366
367 scope.fontDescription().setWeight(scope.fontDescription().bolderWeight());
368 }
369
370 void FontBuilder::setWeightLighter()
371 {
372 FontDescriptionChangeScope scope(this);
373
374 scope.fontDescription().setWeight(scope.fontDescription().lighterWeight());
375 }
376
377 void FontBuilder::setStretch(FontStretch fontStretch) 363 void FontBuilder::setStretch(FontStretch fontStretch)
378 { 364 {
379 FontDescriptionChangeScope scope(this); 365 FontDescriptionChangeScope scope(this);
380 366
381 scope.fontDescription().setStretch(fontStretch); 367 scope.fontDescription().setStretch(fontStretch);
382 } 368 }
383 369
384 void FontBuilder::setScript(const String& locale) 370 void FontBuilder::setScript(const String& locale)
385 { 371 {
386 FontDescriptionChangeScope scope(this); 372 FontDescriptionChangeScope scope(this);
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 FontOrientation fontOrientation; 582 FontOrientation fontOrientation;
597 NonCJKGlyphOrientation glyphOrientation; 583 NonCJKGlyphOrientation glyphOrientation;
598 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation) ; 584 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation) ;
599 fontDescription.setOrientation(fontOrientation); 585 fontDescription.setOrientation(fontOrientation);
600 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); 586 fontDescription.setNonCJKGlyphOrientation(glyphOrientation);
601 documentStyle->setFontDescription(fontDescription); 587 documentStyle->setFontDescription(fontDescription);
602 documentStyle->font().update(fontSelector); 588 documentStyle->font().update(fontSelector);
603 } 589 }
604 590
605 } 591 }
OLDNEW
« no previous file with comments | « Source/core/css/resolver/FontBuilder.h ('k') | Source/core/css/resolver/StyleBuilderConverter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698