I'm afraid the solution of using the option "Embed fonts in the file" with "Embed only characters used in the document" cannot be exploited. Ms Word saves the font using a special format with the extension ODTTF (for example, you have it in "word\fonts\font1.odttf"). But this format is binary, it seems badly documented and thus it stays as a proprietary format. Only Ms Word will be able to build such a sub-file.
Since you haven't any lighter font for the barcode, the only solution I can see is to use image instead of font for you barcode:
- OpenTBS has a feature to easily replace a picture inside a DOCX file (parameter "op=changepic").
- Barcode2Image tools are easy to find in PHP. For example : Barcode Generator.
Then you only have to code your process like this :
- Load the DOCX template,
- Create the temporary image of the barcode.
- Change the image inside the template.
- Merge the template, and save or send the result.
- Delete the temporary image.
It's important to delete the temporary image only after the final merge of the template, because OpenTBS actually inserts the image only when method $tbs->Show() is called.
It's also important to use a different temporary file for each merging because many merges can occur in the same time.
If temporary files have a prefix or are saved into a dedicated directory, then it is advisable to clean up old temporary images regulary.