MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / add_style

Method add_style

src/__init__.py:2286–2297  ·  view source on GitHub ↗

Set some style via CSS style. Replaces complete style spec.

(self, text)

Source from the content-addressed store, hash-verified

2284 return child
2285
2286 def add_style(self, text):
2287 """Set some style via CSS style. Replaces complete style spec."""
2288 style = self.get_attribute_value("style")
2289 if style is not None and text in style:
2290 return self
2291 self.remove_attribute("style")
2292 if style is None:
2293 style = text
2294 else:
2295 style += ";" + text
2296 self.set_attribute("style", style)
2297 return self
2298
2299 def add_subscript(self, text=None):
2300 """Add a subscript ("sub" tag)"""

Callers 8

set_alignMethod · 0.95
set_bgcolorMethod · 0.95
set_leadingMethod · 0.95
set_lineheightMethod · 0.95
set_pagebreak_afterMethod · 0.95
set_pagebreak_beforeMethod · 0.95
set_text_indentMethod · 0.95
append_styled_spanMethod · 0.80

Calls 3

get_attribute_valueMethod · 0.95
remove_attributeMethod · 0.95
set_attributeMethod · 0.95

Tested by

no test coverage detected