Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I use other font weights (such as Book 300 for Open Sans) in my documents?

Adding Open Sans only allows me to use Normal 400, for example.

share|improve this question

It appears that Google docs has very limited functionality for google web fonts right now. For each font you use, you only have the option of the bold weight or normal weight that was set for the web font you selected.

share|improve this answer

Now that Google Apps Script is implemented in Google Documents, it is possible to create font weights:


// global
var app = DocumentApp.getUi();

function onOpen() {
   app.createMenu('Font').addItem('Set font size', 'fontSize')

function fontSize() {
  // selected text
  var selection = DocumentApp.getActiveDocument().getSelection();  

  // create input box
  var fontSize = app.prompt('Add Font Size','Input Integer (> 0)'

  // check if value exists
  if(!fontSize || fontSize == 0) { 
    app.alert("Error","No input present", app.ButtonSet.OK);

  // https://developers.google.com/apps-script/reference/document/selection
  var elements = selection.getSelectedElements();
  for (var i=0, iLen=elements.length; i<iLen; i++) {
    var element = elements[i];

    // Only modify elements that can be edited as text; 
    // skip images and other non-text elements.
    if (element.getElement().editAsText) {
      var text = element.getElement().editAsText();

      // Bold the selected part of the element, 
      // or the full element if it's completely selected.
      if (element.isPartial()) {
          element.getEndOffsetInclusive(), parseInt(fontSize));
      } else {


enter image description here


I've created an example file for you to play around with: Font Size


See the following answer for instructions on how to implement the script (works the same as in a Google Spreadsheet): Font Size in Google Spreadsheets

share|improve this answer
I believe he is asking for font weight, not font size. – bafromca Sep 5 '13 at 17:27
@bafromca I think you're right. – Jacob Jan Tuinstra Sep 5 '13 at 20:28
yes, and there’s only setBold and not setFontWeight, so no chance – flying sheep May 21 '15 at 12:19
You should probably remove this answer as it doesn't answer the question at all. – James Campbell Feb 24 at 2:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.